Module: Resta::Model::ClassMethods
- Defined in:
- lib/resta/model.rb
Overview
Class methods for model after been included.
Instance Attribute Summary collapse
-
#timestamps_opts ⇒ Object
readonly
Returns the value of attribute timestamps_opts.
-
#use_increased_id ⇒ Object
readonly
Returns the value of attribute use_increased_id.
Instance Method Summary collapse
Instance Attribute Details
#timestamps_opts ⇒ Object (readonly)
Returns the value of attribute timestamps_opts.
20 21 22 |
# File 'lib/resta/model.rb', line 20 def @timestamps_opts end |
#use_increased_id ⇒ Object (readonly)
Returns the value of attribute use_increased_id.
20 21 22 |
# File 'lib/resta/model.rb', line 20 def use_increased_id @use_increased_id end |
Instance Method Details
#enable_increased_id ⇒ Object
22 23 24 |
# File 'lib/resta/model.rb', line 22 def enable_increased_id @use_increased_id = true end |
#use_timestamps(fields_opts = nil) ⇒ Object
26 27 28 29 |
# File 'lib/resta/model.rb', line 26 def (fields_opts=nil) fields_opts ||= { update_on_create: true } self.plugin :timestamps, fields_opts end |