1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib/active_model/validations
Yasuo Honda aa3dcabd87 Add Style/RedundantFreeze to remove redudant .freeze
Since Rails 6.0 will support Ruby 2.4.1 or higher
`# frozen_string_literal: true` magic comment is enough to make string object frozen.
This magic comment is enabled by `Style/FrozenStringLiteralComment` cop.

* Exclude these files not to auto correct false positive `Regexp#freeze`
 - 'actionpack/lib/action_dispatch/journey/router/utils.rb'
 - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb'

It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333
Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed.

* Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required

 - 'actionpack/test/controller/test_case_test.rb'
 - 'activemodel/test/cases/type/string_test.rb'
 - 'activesupport/lib/active_support/core_ext/string/strip.rb'
 - 'activesupport/test/core_ext/string_ext_test.rb'
 - 'railties/test/generators/actions_test.rb'
2018-09-29 07:18:44 +00:00
..
absence.rb Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00
acceptance.rb Rails 6 requires Ruby 2.3+ 2018-02-17 10:03:37 -08:00
callbacks.rb Refactor to Array(options[:on]) only once in defining validations 2018-01-01 06:18:39 +09:00
clusivity.rb Rails 6 requires Ruby 2.3+ 2018-02-17 10:03:37 -08:00
confirmation.rb Execute ConfirmationValidator validation when _confirmation's value is false 2017-11-05 19:24:49 +00:00
exclusion.rb [Active Model] require => require_relative 2017-10-21 22:48:27 +09:00
format.rb Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00
helper_methods.rb Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00
inclusion.rb Update validates_inclusion_of example 2018-04-17 21:16:33 -04:00
length.rb Allow passing a Proc or Symbol as an argument to length validator values 2017-10-26 10:01:06 +02:00
numericality.rb Fix numericality validator to still use value before type cast except Active Record 2018-08-24 00:44:02 +09:00
presence.rb Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00
validates.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
with.rb Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00