diff options
author | yui-knk <spiketeika@gmail.com> | 2017-07-14 21:53:12 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2017-09-05 18:18:29 +0900 |
commit | 530b5fea8f3e04c45a20ff3dcc8d473a6d25c1b4 (patch) | |
tree | 048b035c3d61232252cd4e2eb30078ede5c49a17 /actionview/lib/action_view/helpers/tags/text_field.rb | |
parent | c1f9fa8c69590222fac43d58bf64ef4a1225d7ce (diff) | |
download | rails-530b5fea8f3e04c45a20ff3dcc8d473a6d25c1b4.tar.gz rails-530b5fea8f3e04c45a20ff3dcc8d473a6d25c1b4.tar.bz2 rails-530b5fea8f3e04c45a20ff3dcc8d473a6d25c1b4.zip |
Do not pass an instance variable to a private method
`ActionView::Helpers::Tags::Base` has `@object` and
all passed arguments for
* `#value`
* `#value_before_type_cast`
* `#value_came_from_user?`
are `@object`, so we do not need to pass arguments in this case.
Diffstat (limited to 'actionview/lib/action_view/helpers/tags/text_field.rb')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/text_field.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tags/text_field.rb b/actionview/lib/action_view/helpers/tags/text_field.rb index 1d55105587..9bbb3e7510 100644 --- a/actionview/lib/action_view/helpers/tags/text_field.rb +++ b/actionview/lib/action_view/helpers/tags/text_field.rb @@ -10,7 +10,7 @@ module ActionView options = @options.stringify_keys options["size"] = options["maxlength"] unless options.key?("size") options["type"] ||= field_type - options["value"] = options.fetch("value") { value_before_type_cast(object) } unless field_type == "file" + options["value"] = options.fetch("value") { value_before_type_cast } unless field_type == "file" add_default_name_and_id(options) tag("input", options) end |