Module: Tiun::Model
- Defined in:
- lib/tiun/model.rb
Constant Summary collapse
Instance Method Summary collapse
-
#range(range) ⇒ Object
Specify range to return.
-
#tiun ⇒ Object
tiunsets up tiuner for the model. -
#tiuns ⇒ Object
tiunsreturns lists of the tiuned models.
Instance Method Details
#range(range) ⇒ Object
Specify range to return
59 60 61 |
# File 'lib/tiun/model.rb', line 59 def range range offset(range.begin).limit(range.end - range.begin + 1) end |
#tiun ⇒ Object
tiun sets up tiuner for the model. This exports corresponding record fields to default dashboard method, which loads the react component. When the model has been set up, the method returns the compiled data of the model.
Examples:
tiun
Model.tiun
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tiun/model.rb', line 14 def tiun ## return self.instance_variable_get(:@tiun) if self.instance_variables.include?(:@tiun) ## self.instance_variable_set(:@tiun, { fields: _tiun_parse_model}) ## tiuns = self.class.instance_variables.include?(:@tiun) && self.class.instance_variable_get(:@tiuns) || [] ## tiuns << self ## self.class.instance_variable_set(:@tiuns, tiuns) # # belongs_to, has_many, has_one end |