Module: Resta::Model::ClassMethods

Defined in:
lib/resta/model.rb

Overview

Class methods for model after been included.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#timestamps_optsObject (readonly)

Returns the value of attribute timestamps_opts.



20
21
22
# File 'lib/resta/model.rb', line 20

def timestamps_opts
  @timestamps_opts
end

#use_increased_idObject (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_idObject



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 use_timestamps(fields_opts=nil)
  fields_opts ||= { update_on_create: true }
  self.plugin :timestamps, fields_opts
end