instance method
dangerous_class_method?
Ruby on Rails 5.2.8.1
Since v4.1.16Signature
dangerous_class_method?(method_name)
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.)
Parameters
-
method_namereq
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 125
def dangerous_class_method?(method_name)
BLACKLISTED_CLASS_METHODS.include?(method_name.to_s) || class_method_defined_within?(method_name, Base)
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 125
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::ClassMethods