Module: Rows::Model

Included in:
RowsController
Defined in:
lib/rows/model.rb

Instance Method Summary collapse

Instance Method Details

#model_classObject



4
5
6
7
# File 'lib/rows/model.rb', line 4

def model_class
  @_model_class ||= self.class.model_class ||
                    params[:controller].singularize.camelize.constantize
end

#model_nameObject



10
11
12
# File 'lib/rows/model.rb', line 10

def model_name
  @_model_name ||= model_class.model_name.name
end

#model_symbolObject



14
15
16
# File 'lib/rows/model.rb', line 14

def model_symbol
  @_model_symbol ||= model_class.model_name.singular
end

#model_symbol_pluralObject



27
28
29
# File 'lib/rows/model.rb', line 27

def model_symbol_plural
  @_model_symbol_plural ||= model_symbol.pluralize
end