Let's just see if it responds to call instead of checking class.
This commit is contained in:
parent
1149d6018e
commit
06d5e5fc97
|
@ -183,7 +183,7 @@ module SimpleForm
|
|||
options[:as] ||= :select
|
||||
options[:collection] ||= options.fetch(:collection) {
|
||||
conditions = reflection.options[:conditions]
|
||||
conditions = conditions.call if conditions.is_a?(Proc)
|
||||
conditions = conditions.call if conditions.respond_to?(:call)
|
||||
reflection.klass.where(conditions).order(reflection.options[:order]).to_a
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue