diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-08-19 08:12:05 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-08-19 08:16:21 +0900 |
commit | b2c1e29c14b91b290b30c928c63253d1555e0fd9 (patch) | |
tree | 17b4573dbc9c4d4591985b45c0af3c9701666be6 /actionview | |
parent | 9270c6d7fc09b3a1fbbb410f60b9d3829a406c07 (diff) | |
download | rails-b2c1e29c14b91b290b30c928c63253d1555e0fd9.tar.gz rails-b2c1e29c14b91b290b30c928c63253d1555e0fd9.tar.bz2 rails-b2c1e29c14b91b290b30c928c63253d1555e0fd9.zip |
Enable Style/ParenthesesAroundCondition cop
To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/text_helper.rb | 2 | ||||
-rw-r--r-- | actionview/test/template/text_helper_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index 77a1c1fed9..a338d076e4 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -228,7 +228,7 @@ module ActionView # pluralize(2, 'Person', locale: :de) # # => 2 Personen def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale) - word = if (count == 1 || count =~ /^1(\.0+)?$/) + word = if count == 1 || count =~ /^1(\.0+)?$/ singular else plural || singular.pluralize(locale) diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index 45edfe18be..4d47706bda 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -9,7 +9,7 @@ class TextHelperTest < ActionView::TestCase super # This simulates the fact that instance variables are reset every time # a view is rendered. The cycle helper depends on this behavior. - @_cycles = nil if (defined? @_cycles) + @_cycles = nil if defined?(@_cycles) end def test_concat |