diff options
author | Kevin Deisz <kevin.deisz@gmail.com> | 2018-08-24 16:16:41 -0400 |
---|---|---|
committer | Kevin Deisz <kevin.deisz@gmail.com> | 2018-08-24 16:16:41 -0400 |
commit | 0efecd913c07104e8fba82d5044c1ad824af68d5 (patch) | |
tree | 077b4398346ab4b9906ef22ceb1bdf83eb1d64d3 /activerecord/lib | |
parent | cac2bb7f44a6b8e240034d1de89a41fe0dd9f0ec (diff) | |
download | rails-0efecd913c07104e8fba82d5044c1ad824af68d5.tar.gz rails-0efecd913c07104e8fba82d5044c1ad824af68d5.tar.bz2 rails-0efecd913c07104e8fba82d5044c1ad824af68d5.zip |
Convert remaining usage of whitelist and blacklist
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 85591efd36..2e68bdd741 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -31,7 +31,7 @@ module ActiveRecord end } - BLACKLISTED_CLASS_METHODS = %w(private public protected allocate new name parent superclass) + RESTRICTED_CLASS_METHODS = %w(private public protected allocate new name parent superclass) class GeneratedAttributeMethods < Module #:nodoc: include Mutex_m @@ -123,7 +123,7 @@ module ActiveRecord # A class method is 'dangerous' if it is already (re)defined by Active Record, but # not by any ancestors. (So 'puts' is not dangerous but 'new' is.) def dangerous_class_method?(method_name) - BLACKLISTED_CLASS_METHODS.include?(method_name.to_s) || class_method_defined_within?(method_name, Base) + RESTRICTED_CLASS_METHODS.include?(method_name.to_s) || class_method_defined_within?(method_name, Base) end def class_method_defined_within?(name, klass, superklass = klass.superclass) # :nodoc: |