user.rb 237 Bytes
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1 2
class User < ActiveRecord::Base
  belongs_to :account, inverse_of: :user
Eugen Rochko's avatar
Eugen Rochko committed
3 4

  validates :account, presence: true
5 6 7 8

  def timeline
    StreamEntry.where(account_id: self.account.following, activity_type: 'Status').order('id desc')
  end
Eugen Rochko's avatar
Eugen Rochko committed
9
end