diff --git a/lib/cocoon/view_helpers.rb b/lib/cocoon/view_helpers.rb index 1d30e31..8072a8a 100644 --- a/lib/cocoon/view_helpers.rb +++ b/lib/cocoon/view_helpers.rb @@ -81,7 +81,7 @@ module Cocoon def create_object(f, 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) end