class Esquema::SchemaEnhancer
def validate_property_as_attribute_for(prop_name, options = {})
-
(ArgumentError)
- If the property is not a valid attribute for the model.
Parameters:
-
options
(Hash
) -- Additional options for the property. -
prop_name
(Symbol
) -- The name of the property.
def validate_property_as_attribute_for(prop_name, options = {}) return if options[:virtual] == true raise ArgumentError, "`#{prop_name}` is not a model attribute." unless valid_properties.include?(prop_name.to_sym) end