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.



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

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

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#route_keyObject



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

def route_key
  plural
end

#translate(options = {}) ⇒ Object



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

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