Sha256: 7f4a0bf1b455cc898ebe4415d9c6694616b6c346c55180299394d03b99fa9be4

Contents?: true

Size: 419 Bytes

Versions: 23

Compression:

Stored size: 419 Bytes

Contents

module Torque
  module PostgreSQL
    module I18n

      # Adds extra suport to localize durations
      # This is a temporary solution, since 3600.seconds do not translate into
      # 1 hour
      def localize(locale, object, format = :default, options = {})
        return super unless object.is_a?(ActiveSupport::Duration)
        object.inspect
      end

    end

    ::I18n::Backend::Base.prepend I18n
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
torque-postgresql-0.2.16 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.15 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.14 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.13 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.12 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.11 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.10 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.9 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.8 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.7 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.6 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.5 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.4 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.3 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.2 lib/torque/postgresql/i18n.rb
torque-postgresql-0.2.1 lib/torque/postgresql/i18n.rb
torque-postgresql-0.1.7 lib/torque/postgresql/i18n.rb
torque-postgresql-0.1.6 lib/torque/postgresql/i18n.rb
torque-postgresql-0.1.5 lib/torque/postgresql/i18n.rb
torque-postgresql-0.1.4 lib/torque/postgresql/i18n.rb