diff options
author | Xavier Noria <fxn@hashref.com> | 2016-09-01 23:41:49 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-09-01 23:41:49 +0200 |
commit | bb1ecdcc677bf6e68e0252505509c089619b5b90 (patch) | |
tree | 99dd8fd164e1c582216a4b08c3d066049217bb7f /actionview/lib/action_view/helpers | |
parent | 8c402ef425771c3dbb4659dd946714e69fdf5ce9 (diff) | |
download | rails-bb1ecdcc677bf6e68e0252505509c089619b5b90.tar.gz rails-bb1ecdcc677bf6e68e0252505509c089619b5b90.tar.bz2 rails-bb1ecdcc677bf6e68e0252505509c089619b5b90.zip |
fixes remaining RuboCop issues [Vipul A M, Xavier Noria]
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/capture_helper.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb index 5b569b5923..719592b5c5 100644 --- a/actionview/lib/action_view/helpers/capture_helper.rb +++ b/actionview/lib/action_view/helpers/capture_helper.rb @@ -37,7 +37,7 @@ module ActionView def capture(*args) value = nil buffer = with_output_buffer { value = yield(*args) } - if string = buffer.presence || value and string.is_a?(String) + if (string = buffer.presence || value) && string.is_a?(String) ERB::Util.html_escape string end end diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index b82dff1c17..124a14f1d9 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1287,7 +1287,7 @@ module ActionView @object_name, @object, @template, @options = object_name, object, template, options @default_options = @options ? @options.slice(:index, :namespace) : {} if @object_name.to_s.match(/\[\]$/) - if object ||= @template.instance_variable_get("@#{Regexp.last_match.pre_match}") and object.respond_to?(:to_param) + if (object ||= @template.instance_variable_get("@#{Regexp.last_match.pre_match}")) && object.respond_to?(:to_param) @auto_index = object.to_param else raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}" |