Module: Rows::Model
- Included in:
- RowsController
- Defined in:
- lib/rows/model.rb
Instance Method Summary collapse
Instance Method Details
#model_class ⇒ Object
4 5 6 7 8 9 |
# File 'lib/rows/model.rb', line 4 def model_class # rubocop: disable @_model_class ||= self.class.model_class || Kernel.const_get(params[:controller].classify) # rubocop: enable end |
#model_name ⇒ Object
12 13 14 |
# File 'lib/rows/model.rb', line 12 def model_name @_model_name ||= model_class.model_name.name end |
#model_symbol ⇒ Object
16 17 18 |
# File 'lib/rows/model.rb', line 16 def model_symbol @_model_symbol ||= model_class.model_name.singular end |
#model_symbol_plural ⇒ Object
29 30 31 |
# File 'lib/rows/model.rb', line 29 def model_symbol_plural @_model_symbol_plural ||= model_symbol.pluralize end |