Class: Override

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/override.rb

Instance Method Summary collapse

Instance Method Details

#field_name_exists_on_associated_modelObject



10
11
12
13
14
15
# File 'app/models/override.rb', line 10

def field_name_exists_on_associated_model
  klass =  overrideable_type.constantize
  unless klass.attribute_names.include?(field_name)
    errors.add(:field_name, "must be an attribute of #{overrideable_type}")
  end
end