Permalink
Browse files

raise ArgumentError when has_one association was provided

  • Loading branch information...
nashby committed Sep 13, 2012
1 parent 7710c3b commit 0bb5726aa35019683456f6a60694303f79872b05
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/simple_form/form_builder.rb
  2. +1 −1 test/form_builder/association_test.rb
@@ -183,7 +183,7 @@ def association(association, options={}, &block)
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 @@ def with_association_for(object, *args)
# 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

0 comments on commit 0bb5726

Please sign in to comment.