Class: Spree::PaymentMethod::ModelName
- Inherits:
-
ActiveModel::Name
- Object
- ActiveModel::Name
- Spree::PaymentMethod::ModelName
- Defined in:
- app/models/spree/payment_method.rb
Overview
Custom ModelName#human implementation to ensure we don’t refer to subclasses as just “PaymentMethod”
Instance Method Summary collapse
-
#human(options = {}) ⇒ Object
Similar to ActiveModel::Name#human, but skips lookup_ancestors.
Instance Method Details
#human(options = {}) ⇒ Object
Similar to ActiveModel::Name#human, but skips lookup_ancestors
51 52 53 54 55 56 57 58 59 |
# File 'app/models/spree/payment_method.rb', line 51 def human( = {}) defaults = [ i18n_key, [:default], @human ].compact = { scope: [:activerecord, :models], count: 1, default: defaults }.merge!(.except(:default)) I18n.translate(defaults.shift, **) end |