Skip to content
Browse files

Small changes

  • Loading branch information...
1 parent 78043bc commit cc8cbbac0508c8950664997ce7694a56f718d7d4 @rwdaigle rwdaigle committed Aug 19, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/utility_scopes/ordered.rb
View
4 lib/utility_scopes/ordered.rb
@@ -21,7 +21,9 @@ module ClassMethods
def ordered_by(clause = 'created_at DESC')
# Add named scope
- named_scope :ordered, lambda { |*order| { :order => order.blank? ? self.default_ordering : order } }
+ named_scope :ordered, lambda { |*order|
+ { :order => order.flatten.first || self.default_ordering }
+ }
# Give the class it's convenience "orderings" and "default_ordering" accessors
metaclass.instance_eval do

0 comments on commit cc8cbba

Please sign in to comment.
Something went wrong with that request. Please try again.