Limit Atom feeds to 20 items by default, add pagination by max_id
(But there are no Atom feed pagination elements yet)
This commit is contained in:
parent
c8999a116e
commit
7e58303a8d
3 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,8 @@ class StreamEntry < ActiveRecord::Base
|
|||
|
||||
validates :account, :activity, presence: true
|
||||
|
||||
scope :with_includes, -> { includes(:activity) }
|
||||
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]) }
|
||||
|
||||
def object_type
|
||||
orphaned? ? :activity : (targeted? ? :activity : self.activity.object_type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue