Sha256: aacf748c2cbe823eb77d7085353f47f3816438d5109cf2f30bdd99f690dd58b4

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

module Dorsale::ModelI18n
  extend ActiveSupport::Concern

  def t(*args)
    self.class.t(*args)
  end

  def ts
    self.class.ts
  end

  class_methods do
    def t(*args)
      if args.any?
        human_attribute_name(*args)
      else
        model_name.human
      end
    end

    def ts
      model_name.human(count: 2)
    end
  end # class_methods
end # Dorsale::ModelI18n

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dorsale-3.4.0 app/models/concerns/dorsale/model_i18n.rb