Let's just see if it responds to call instead of checking class.

This commit is contained in:
Bradly Feeley 2013-05-26 08:59:26 -07:00
parent 1149d6018e
commit 06d5e5fc97
1 changed files with 1 additions and 1 deletions

View File

@ -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
}