Permalink
Browse files

Remove `FormBuilder` deprecation warning about block argument and ass…

…ociated tests
  • Loading branch information...
1 parent cd74f02 commit 38aafc037705aab2f09ec924bf634d105002e016 @vipulnsward vipulnsward 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 38aafc0

Please sign in to comment.