Module: Filemaker::Model::Fields

Extended by:
ActiveSupport::Concern
Included in:
Components
Defined in:
lib/filemaker/model/fields.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

TYPE_MAPPINGS =
{
  string: String,
  date: Date,
  datetime: DateTime,
  money: BigDecimal,
  integer: Integer,
  number: BigDecimal
}

Instance Method Summary collapse

Instance Method Details

#apply_defaultsObject



22
23
24
25
26
27
# File 'lib/filemaker/model/fields.rb', line 22

def apply_defaults
  attribute_names.each do |name|
    field = fields[name]
    attributes[name] = field.default_value
  end
end

#attribute_namesObject



29
30
31
# File 'lib/filemaker/model/fields.rb', line 29

def attribute_names
  self.class.attribute_names
end

#fm_namesObject



33
34
35
# File 'lib/filemaker/model/fields.rb', line 33

def fm_names
  fields.values.map(&:fm_name)
end