mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Mongoid compatibility improvement in belongs_to case (no more: undefined method `options' for #<Mongoid::Relations::Metadata>)
This commit is contained in:
parent
9f7a7bcbb9
commit
2c26c19c2c
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue