lib/searchlogic/named_scopes/or_conditions.rb in searchlogic-2.4.8 vs lib/searchlogic/named_scopes/or_conditions.rb in searchlogic-2.4.9

- old
+ new

@@ -129,10 +129,11 @@ def merge_scopes_with_or(scopes) scopes_options = scopes.collect { |scope| scope.scope(:find) } conditions = scopes_options.reject { |o| o[:conditions].nil? }.collect { |o| sanitize_sql(o[:conditions]) } scope = scopes_options.inject(scoped({})) { |current_scope, options| current_scope.scoped(options) } - options = scope.scope(:find) + options = {} + in_searchlogic_delegation { options = scope.scope(:find) } options.delete(:readonly) unless scopes.any? { |scope| scope.proxy_options.key?(:readonly) } options.merge(:conditions => "(" + conditions.join(") OR (") + ")") end end end