Module: Filemaker::Model
- Extended by:
- ActiveSupport::Concern
- Includes:
- Components
- Defined in:
- lib/filemaker/model.rb,
lib/filemaker/model/field.rb,
lib/filemaker/model/fields.rb,
lib/filemaker/model/builder.rb,
lib/filemaker/model/criteria.rb,
lib/filemaker/model/findable.rb,
lib/filemaker/model/optional.rb,
lib/filemaker/model/relations.rb,
lib/filemaker/model/components.rb,
lib/filemaker/model/pagination.rb,
lib/filemaker/model/selectable.rb,
lib/filemaker/model/persistable.rb,
lib/filemaker/model/relations/proxy.rb,
lib/filemaker/model/relations/has_many.rb,
lib/filemaker/model/relations/belongs_to.rb,
lib/filemaker/model/relations/has_portal.rb
Defined Under Namespace
Modules: Builder, ClassMethods, Components, Fields, Findable, Optional, Pagination, Persistable, Relations, Selectable Classes: Criteria, Field
Constant Summary
Constants included from Fields
Instance Attribute Summary collapse
-
#attributes ⇒ Boolean
readonly
Indicates if this is a new fresh record.
-
#mod_id ⇒ Boolean
readonly
Indicates if this is a new fresh record.
-
#new_record ⇒ Boolean
readonly
Indicates if this is a new fresh record.
-
#portals ⇒ Boolean
readonly
Indicates if this is a new fresh record.
-
#record_id ⇒ Boolean
readonly
Indicates if this is a new fresh record.
Instance Method Summary collapse
- #fm_attributes ⇒ Object
- #id ⇒ Object
- #identity_id ⇒ Object
- #initialize(attrs = nil) ⇒ Object
- #new_record? ⇒ Boolean
- #persisted? ⇒ Boolean
- #to_a ⇒ Object
- #to_param ⇒ Object
Methods included from Persistable
#assign_attributes, #create, #destroy, #save, #save!, #update, #update_attributes
Methods included from Fields
#apply_defaults, #attribute_names, #fm_names
Instance Attribute Details
#attributes ⇒ Boolean (readonly)
Returns indicates if this is a new fresh record.
9 10 11 |
# File 'lib/filemaker/model.rb', line 9 def attributes @attributes end |
#mod_id ⇒ Boolean (readonly)
Returns indicates if this is a new fresh record.
9 10 11 |
# File 'lib/filemaker/model.rb', line 9 def mod_id @mod_id end |
#new_record ⇒ Boolean (readonly)
Returns indicates if this is a new fresh record.
9 10 11 |
# File 'lib/filemaker/model.rb', line 9 def new_record @new_record end |
#portals ⇒ Boolean (readonly)
Returns indicates if this is a new fresh record.
9 10 11 |
# File 'lib/filemaker/model.rb', line 9 def portals @portals end |
#record_id ⇒ Boolean (readonly)
Returns indicates if this is a new fresh record.
9 10 11 |
# File 'lib/filemaker/model.rb', line 9 def record_id @record_id end |
Instance Method Details
#fm_attributes ⇒ Object
48 49 50 |
# File 'lib/filemaker/model.rb', line 48 def fm_attributes self.class.with_model_fields(attributes) end |
#id ⇒ Object
36 37 38 |
# File 'lib/filemaker/model.rb', line 36 def id self.class.identity ? identity_id : record_id end |
#identity_id ⇒ Object
40 41 42 |
# File 'lib/filemaker/model.rb', line 40 def identity_id public_send(identity.name) if identity end |
#initialize(attrs = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/filemaker/model.rb', line 16 def initialize(attrs = nil) @new_record = true @attributes = {} @relations = {} apply_defaults process_attributes(attrs) end |
#new_record? ⇒ Boolean
24 25 26 |
# File 'lib/filemaker/model.rb', line 24 def new_record? new_record end |
#persisted? ⇒ Boolean
28 29 30 |
# File 'lib/filemaker/model.rb', line 28 def persisted? !new_record? end |
#to_a ⇒ Object
32 33 34 |
# File 'lib/filemaker/model.rb', line 32 def to_a [self] end |
#to_param ⇒ Object
44 45 46 |
# File 'lib/filemaker/model.rb', line 44 def to_param id.to_s if id end |