Merge pull request #417 from nyjt/patch-1
Mongoid compatibility improvement in belongs_to case
This commit is contained in:
commit
75a6ff6b78
|
@ -173,7 +173,7 @@ module SimpleForm
|
|||
|
||||
attribute = case reflection.macro
|
||||
when :belongs_to
|
||||
reflection.options[:foreign_key] || :"#{reflection.name}_id"
|
||||
(reflection.respond_to?(:options) && reflection.options[:foreign_key]) || :"#{reflection.name}_id"
|
||||
when :has_one
|
||||
raise ":has_one associations are not supported by f.association"
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue