Permalink
Browse files

Merge pull request #11227 from vipulnsward/form_builder

Remove `FormBuilder` deprecation warning about block argument and tests
  • Loading branch information...
2 parents dc9ff7b + 38aafc0 commit 53394420287009ac18ddb2831c981ea93e9491d0 @senny senny committed Jul 1, 2013
View
@@ -1,3 +1,7 @@
+* Remove deprecated block passing to FormBuilder#new.
+
+ *Vipul A M*
+
* Pick `DateField` `DateTimeField` and `ColorField` values from stringified options allowing use of symbol keys with helpers.
*Jon Rowe*
@@ -1237,11 +1237,7 @@ def to_model
self
end
- def initialize(object_name, object, template, options, block=nil)
- if block
- ActiveSupport::Deprecation.warn "Giving a block to FormBuilder is deprecated and has no effect anymore."
- end
-
+ def initialize(object_name, object, template, options)
@nested_child_index = {}
@object_name, @object, @template, @options = object_name, object, template, options
@default_options = @options ? @options.slice(:index, :namespace) : {}
@@ -2916,18 +2916,6 @@ def test_fields_for_returns_block_result
assert_equal "fields", output
end
- def test_form_builder_block_argument_deprecation
- builder_class = Class.new(ActionView::Helpers::FormBuilder) do
- def initialize(object_name, object, template, options, block)
- super
- end
- end
-
- assert_deprecated(/Giving a block to FormBuilder is deprecated and has no effect anymore/) do
- builder_class.new(:foo, nil, nil, {}, proc {})
- end
- end
-
def test_form_for_only_instantiates_builder_once
initialization_count = 0
builder_class = Class.new(ActionView::Helpers::FormBuilder) do

0 comments on commit 5339442

Please sign in to comment.