mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove FormBuilder
deprecation warning about block argument and associated tests
This commit is contained in:
parent
cd74f0292f
commit
38aafc0377
3 changed files with 5 additions and 17 deletions
|
@ -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 @@ module ActionView
|
|||
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 @@ class FormHelperTest < ActionView::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue