Module: EmbeddedAssociation
Instance Method Summary
collapse
#embed_many, #embed_one, #field, #many, #modify_field, #one, #remove_field
Instance Method Details
21
22
23
|
# File 'lib/yodel/models/core/associations/embedded/embedded_association.rb', line 21
def default_input_type
:embedded
end
|
#fields ⇒ Object
8
9
10
|
# File 'lib/yodel/models/core/associations/embedded/embedded_association.rb', line 8
def fields
@fields ||= fields_field.typecast(@options['fields'], nil)
end
|
#fields_field ⇒ Object
4
5
6
|
# File 'lib/yodel/models/core/associations/embedded/embedded_association.rb', line 4
def fields_field
@fields_field ||= FieldsField.new(name)
end
|
#options ⇒ Object
12
13
14
|
# File 'lib/yodel/models/core/associations/embedded/embedded_association.rb', line 12
def options
@options.merge({'fields' => fields_field.untypecast(fields, nil)})
end
|
#validate(record, errors) ⇒ Object
16
17
18
19
|
# File 'lib/yodel/models/core/associations/embedded/embedded_association.rb', line 16
def validate(record, errors)
EmbeddedRecordsValidation.validate(self, record.get(name), record, errors)
super(record, errors)
end
|