51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'app/services/api_maker/validation_errors_generator_service.rb', line 51
def attribute_type(model, attribute_name)
if model.attribute_names.include?(attribute_name.to_s)
:attribute
elsif model.class.const_defined?(:ADDITIONAL_ATTRIBUTES_FOR_VALIDATION_ERRORS) &&
model.class.const_get(:ADDITIONAL_ATTRIBUTES_FOR_VALIDATION_ERRORS).include?(attribute_name)
:additional_attribute_for_validation
elsif model._reflections.key?(attribute_name.to_s)
:reflection
elsif model.class.try(:monetized_attributes)&.include?(attribute_name.to_s)
:monetized_attribute
elsif attribute_name == :base
:base
end
end
|