instance method
detect_enum_conflict!
Ruby on Rails 5.0.7.2
Since v4.1.16 Private — implementation detail, not part of the public APISignature
detect_enum_conflict!(enum_name, method_name, klass_method = false)
No documentation comment.
Parameters
-
enum_namereq -
method_namereq -
klass_methodopt = false
Source
# File activerecord/lib/active_record/enum.rb, line 217
def detect_enum_conflict!(enum_name, method_name, klass_method = false)
if klass_method && dangerous_class_method?(method_name)
raise_conflict_error(enum_name, method_name, type: 'class')
elsif !klass_method && dangerous_attribute_method?(method_name)
raise_conflict_error(enum_name, method_name)
elsif !klass_method && method_defined_within?(method_name, _enum_methods_module, Module)
raise_conflict_error(enum_name, method_name, source: 'another enum')
end
end
Defined in activerecord/lib/active_record/enum.rb line 217
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Enum