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 4c59d08 commit 0467688
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 @@ -212,6 +212,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 0467688

Please sign in to comment.