lib/searchlogic/named_scopes/ordering.rb in searchlogic-2.1.5 vs lib/searchlogic/named_scopes/ordering.rb in searchlogic-2.1.6
- old
+ new
@@ -1,10 +1,10 @@
module Searchlogic
module NamedScopes
# Handles dynamically creating named scopes for orderin by columns.
module Ordering
- def condition?(name) # :nodoc:
+ def local_condition?(name) # :nodoc:
super || order_condition?(name)
end
def primary_condition_name(name) # :nodoc
if result = super
@@ -35,10 +35,10 @@
super
end
end
def order_condition_details(name)
- if name.to_s =~ /^(ascend|descend)_by_(\w+)$/
+ if name.to_s =~ /^(ascend|descend)_by_(#{column_names.join("|")})$/
{:order_as => $1, :column => $2}
elsif name.to_s =~ /^order$/
{}
end
end
\ No newline at end of file