Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Small changes

  • Loading branch information...
commit cc8cbbac0508c8950664997ce7694a56f718d7d4 1 parent 78043bc
Ryan Daigle rwdaigle authored

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 1 lib/utility_scopes/ordered.rb
4 lib/utility_scopes/ordered.rb
@@ -21,7 +21,9 @@ module ClassMethods
21 21 def ordered_by(clause = 'created_at DESC')
22 22
23 23 # Add named scope
24   - named_scope :ordered, lambda { |*order| { :order => order.blank? ? self.default_ordering : order } }
  24 + named_scope :ordered, lambda { |*order|
  25 + { :order => order.flatten.first || self.default_ordering }
  26 + }
25 27
26 28 # Give the class it's convenience "orderings" and "default_ordering" accessors
27 29 metaclass.instance_eval do

0 comments on commit cc8cbba

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