Sha256: c6b69a96666dc9db9fa0ed5941c4493f092c7bddff3e5a27c65348d247c4cc5e

Contents?: true

Size: 421 Bytes

Versions: 15

Compression:

Stored size: 421 Bytes

Contents

module Torque
  module PostgreSQL
    module I18n

      # Adds extra suport to localize durations
      # This is a temporary solution, since 3600.seconds does 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

15 entries across 15 versions & 1 rubygems

Version Path
torque-postgresql-1.1.8 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.7 lib/torque/postgresql/i18n.rb
torque-postgresql-2.0.3 lib/torque/postgresql/i18n.rb
torque-postgresql-2.0.2 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.6 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.5 lib/torque/postgresql/i18n.rb
torque-postgresql-2.0.1 lib/torque/postgresql/i18n.rb
torque-postgresql-2.0.0 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.4 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.3 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.2 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.1 lib/torque/postgresql/i18n.rb
torque-postgresql-1.1.0 lib/torque/postgresql/i18n.rb
torque-postgresql-1.0.1 lib/torque/postgresql/i18n.rb
torque-postgresql-1.0.0 lib/torque/postgresql/i18n.rb