Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

forgot to call it off the association class

  • Loading branch information...
commit 7f63021999ec863a47951f539ac7e5713bcbe1ed 1 parent 28c526d
@binarylogic authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/searchlogic/named_scopes/association_conditions.rb
View
2  lib/searchlogic/named_scopes/association_conditions.rb
@@ -91,7 +91,7 @@ def arity_args(arity)
def prepare_named_scope_options(options, association)
options.delete(:readonly) # AR likes to set :readonly to true when using the :joins option, we don't want that
- options[:conditions] = sanitize_sql_for_conditions(options[:conditions]) if options[:conditions].is_a?(Hash)
+ options[:conditions] = association.klass.sanitize_sql_for_conditions(options[:conditions]) if options[:conditions].is_a?(Hash)
if options[:joins].is_a?(String) || array_of_strings?(options[:joins])
options[:joins] = [inner_joins(association.name), options[:joins]].flatten

1 comment on commit 7f63021

@laserlemon

Do you ever sleep?

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