Skip to content

Commit

Permalink
Adding by_most_recent automatic scope
Browse files Browse the repository at this point in the history
  • Loading branch information
tslocke committed Jun 25, 2008
1 parent ae71304 commit 06901c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hobo/lib/hobo/scopes/automatic_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ def create_scope
else

case name

when "by_most_recent"
def_scope do
{ :order => "#{@klass.table_name}.created_at DESC" }
end

when "recent"
def_scope do |*args|
Expand Down

0 comments on commit 06901c3

Please sign in to comment.