Class: ActiveAdmin::Resource::Name

Inherits:
ActiveModel::Name
  • Object
show all
Defined in:
lib/active_admin/resource/naming.rb

Instance Method Summary (collapse)

Constructor Details

- (Name) initialize(klass, name = nil)

Returns a new instance of Name



44
45
46
# File 'lib/active_admin/resource/naming.rb', line 44

def initialize(klass, name = nil)
  super(klass, nil, name)
end

Instance Method Details

- (Boolean) eql?(other)

Returns:

  • (Boolean)


56
57
58
# File 'lib/active_admin/resource/naming.rb', line 56

def eql?(other)
  to_str.eql?(other.to_str)
end

- (Object) route_key



52
53
54
# File 'lib/active_admin/resource/naming.rb', line 52

def route_key
  plural
end

- (Object) translate(options = {})



48
49
50
# File 'lib/active_admin/resource/naming.rb', line 48

def translate(options = {})
  I18n.t i18n_key, {scope: [:activerecord, :models]}.merge(options)
end