Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modified Searchlogic::Search#normalize_scope_name to account for user…

…-defined scopes that share their names with column names.
  • Loading branch information...
commit 8af5bfc528394dc2a2ca4d470debe1bbf7a3ab65 1 parent f40ec25
@laserlemon laserlemon authored committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/searchlogic/search.rb
View
6 lib/searchlogic/search.rb
@@ -117,7 +117,11 @@ def method_missing(name, *args, &block)
end
def normalize_scope_name(scope_name)
- klass.column_names.include?(scope_name.to_s) ? "#{scope_name}_equals".to_sym : scope_name.to_sym
+ case
+ when klass.scopes.key?(scope_name.to_sym) then scope_name.to_sym
+ when klass.column_names.include?(scope_name.to_s) then "#{scope_name}_equals".to_sym
+ else scope_name.to_sym
+ end
end
def setter?(name)
Please sign in to comment.
Something went wrong with that request. Please try again.