Make sure cocoon still works on rails 3.0 (where conditions is not yet supported). Fixes #47.
This commit is contained in:
parent
239790d44c
commit
7bcd2aa98d
@ -81,7 +81,7 @@ module Cocoon
|
|||||||
|
|
||||||
def create_object(f, association)
|
def create_object(f, association)
|
||||||
assoc = f.object.class.reflect_on_association(association)
|
assoc = f.object.class.reflect_on_association(association)
|
||||||
conditions = assoc.conditions.flatten
|
conditions = assoc.respond_to?(:conditions) ? assoc.conditions.flatten : []
|
||||||
new_object = assoc.klass.new(*conditions)
|
new_object = assoc.klass.new(*conditions)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user