Refactoring Grape API methods into normal controllers & other things
This commit is contained in:
parent
11ff92c9d7
commit
0e8f59c16f
63 changed files with 336 additions and 406 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue