Skip to content

Commit

Permalink
#1021 Conditions in has_many through associations give an error like …
Browse files Browse the repository at this point in the history
…undefined method `%' for [["categories.frame=?", 1]]:Array
  • Loading branch information
adoyen committed Sep 27, 2012
1 parent d207920 commit 7f87e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hobo/lib/hobo/model/accessible_associations.rb
Expand Up @@ -10,7 +10,7 @@ def prepare_has_many_assignment(association, association_name, array_or_hash)
array = params_hash_to_array(array_or_hash)
array.map! do |record_hash_or_string|
finder = association.member_class
conditions = association.proxy_association.reflection.conditions
conditions = association.proxy_association.reflection.options[:conditions]
finder = finder.scoped :conditions => conditions unless conditions == [[]] || conditions == [[],[]]
find_or_create_and_update(owner, association_name, finder, record_hash_or_string) do |id|
# The block is required to either locate find an existing record in the collection, or build a new one
Expand Down

0 comments on commit 7f87e39

Please sign in to comment.