Skip to content

Commit

Permalink
Simpler syntax for active record scope
Browse files Browse the repository at this point in the history
  • Loading branch information
denny committed Sep 5, 2024
1 parent 3f7bae2 commit 434d95a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ module Post
scope :most_recent_first, -> { order( posted_at: :desc ) }
scope :with_discussions, -> { includes( [ :discussion ] ) }
scope :published, -> { visible.not_future_dated }
scope :recent, -> { published.merge( most_recent_first ) }
scope :recent, -> { published.most_recent_first }

mattr_reader :implicit_order_column, default: :posted_at

0 comments on commit 434d95a

Please sign in to comment.