diff options
Diffstat (limited to 'app/models/stream_entry.rb')
-rw-r--r-- | app/models/stream_entry.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/stream_entry.rb b/app/models/stream_entry.rb index d64edd62f..35eab1df0 100644 --- a/app/models/stream_entry.rb +++ b/app/models/stream_entry.rb @@ -1,11 +1,12 @@ class StreamEntry < ActiveRecord::Base + include Paginable + belongs_to :account, inverse_of: :stream_entries belongs_to :activity, polymorphic: true validates :account, :activity, presence: true - scope :with_includes, -> { includes(:activity) } - scope :paginate_by_max_id, -> (limit, max_id) { order('id desc').limit(limit).where(max_id.nil? ? '1=1' : ['id < ?', max_id]) } + scope :with_includes, -> { includes(:activity) } def object_type orphaned? ? :activity : (targeted? ? :activity : self.activity.object_type) |