diff --git a/lib/simple_form/form_builder.rb b/lib/simple_form/form_builder.rb index 7680c6e5..e6b561f6 100644 --- a/lib/simple_form/form_builder.rb +++ b/lib/simple_form/form_builder.rb @@ -182,7 +182,9 @@ module SimpleForm options[:as] ||= :select options[:collection] ||= options.fetch(:collection) { - reflection.klass.where(reflection.options[:conditions]).order(reflection.options[:order]).to_a + conditions = reflection.options[:conditions] + conditions = conditions.call if conditions.is_a?(Proc) + reflection.klass.where(conditions).order(reflection.options[:order]).to_a } attribute = case reflection.macro