Class: ActiveAdmin::Resource::Name

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

Instance Method Summary collapse

Constructor Details

#initialize(klass, name = nil) ⇒ Name

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#route_keyObject



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

def route_key
  plural
end

#translate(options = {}) ⇒ Object



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