raise ArgumentError when has_one association was provided
This commit is contained in:
parent
7710c3b0e9
commit
0bb5726aa3
|
@ -183,7 +183,7 @@ module SimpleForm
|
|||
when :belongs_to
|
||||
(reflection.respond_to?(:options) && reflection.options[:foreign_key]) || :"#{reflection.name}_id"
|
||||
when :has_one
|
||||
raise ":has_one associations are not supported by f.association"
|
||||
raise ArgumentError, ":has_one associations are not supported by f.association"
|
||||
else
|
||||
if options[:as] == :select
|
||||
html_options = options[:input_html] ||= {}
|
||||
|
|
|
@ -120,7 +120,7 @@ class AssociationTest < ActionView::TestCase
|
|||
|
||||
# ASSOCIATIONS - has_*
|
||||
test 'builder does not allow has_one associations' do
|
||||
assert_raise RuntimeError do
|
||||
assert_raise ArgumentError do
|
||||
with_association_for @user, :first_company, :as => :radio_buttons
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue