Refactoring Grape API methods into normal controllers & other things
This commit is contained in:
@@ -76,6 +76,10 @@ class Account < ActiveRecord::Base
|
||||
@avatar_remote_url = url
|
||||
end
|
||||
|
||||
def to_param
|
||||
self.username
|
||||
end
|
||||
|
||||
before_create do
|
||||
if local?
|
||||
keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 1024 : 2048)
|
||||
|
@@ -1,9 +1,4 @@
|
||||
class User < ActiveRecord::Base
|
||||
belongs_to :account, inverse_of: :user
|
||||
|
||||
validates :account, presence: true
|
||||
|
||||
def timeline
|
||||
StreamEntry.where(account_id: self.account.following, activity_type: 'Status').order('id desc')
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user