Sha256: b039ca2c341c72338a7fcaa4cda5d0275a55e46a3c9f4b48dfdb0b67c7bbff40

Contents?: true

Size: 383 Bytes

Versions: 13

Compression:

Stored size: 383 Bytes

Contents

module Dorsale
  module ModelI18n
    def t(*args)
      self.class.t(*args)
    end

    def self.included(model)
      model.instance_eval do
        def t(*args)
          if args.any?
            human_attribute_name(*args)
          else
            model_name.human
          end
        end
      end
    end
  end
end

ActiveRecord::Base.send(:include, ::Dorsale::ModelI18n)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dorsale-2.3.4 lib/dorsale/model_i18n.rb
dorsale-2.3.3 lib/dorsale/model_i18n.rb
dorsale-2.3.2 lib/dorsale/model_i18n.rb
dorsale-2.3.1 lib/dorsale/model_i18n.rb
dorsale-2.3.0 lib/dorsale/model_i18n.rb
dorsale-2.2.16 lib/dorsale/model_i18n.rb
dorsale-2.2.15 lib/dorsale/model_i18n.rb
dorsale-2.2.14 lib/dorsale/model_i18n.rb
dorsale-2.2.13 lib/dorsale/model_i18n.rb
dorsale-2.2.12 lib/dorsale/model_i18n.rb
dorsale-2.2.11 lib/dorsale/model_i18n.rb
dorsale-2.2.10 lib/dorsale/model_i18n.rb
dorsale-2.2.9 lib/dorsale/model_i18n.rb