Module: Effective::Resources::I18n

Included in:
Effective::Resource
Defined in:
app/models/effective/resources/i18n.rb

Instance Method Summary collapse

Instance Method Details

#human_nameObject



7
8
9
10
11
12
13
# File 'app/models/effective/resources/i18n.rb', line 7

def human_name
  if klass.respond_to?(:model_name)
    klass.model_name.human
  else
    name.gsub('::', ' ').underscore.gsub('_', ' ')
  end
end

#human_plural_nameObject



15
16
17
18
19
20
21
# File 'app/models/effective/resources/i18n.rb', line 15

def human_plural_name
  if klass.respond_to?(:model_name)
    klass.model_name.human.pluralize
  else
    name.pluralize.gsub('::', ' ').underscore.gsub('_', ' ')
  end
end