Sha256: c58ead7bdf1ac3a81b91c71212aaf46f9c36ed0c1425a690e935cb1a7802a0f8

Contents?: true

Size: 546 Bytes

Versions: 24

Compression:

Stored size: 546 Bytes

Contents

# frozen_string_literal: true

require 'i18n/backend/active_record'

unless defined?(Translation)
  Translation = I18n::Backend::ActiveRecord::Translation
  Translation.include Spotlight::CustomTranslationExtension

  # Work-around for https://github.com/svenfuchs/i18n-active_record/pull/133
  if Translation.respond_to?(:to_hash)
    class << Translation
      alias to_h to_hash
      remove_method :to_hash
    end

    I18n::Backend::ActiveRecord.define_method(:init_translations) do
      @translations = Translation.to_h
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/models/translation.rb
blacklight-spotlight-4.3.5 app/models/translation.rb
blacklight-spotlight-4.3.4 app/models/translation.rb
blacklight-spotlight-4.3.3 app/models/translation.rb
blacklight-spotlight-4.3.2 app/models/translation.rb
blacklight-spotlight-4.3.1 app/models/translation.rb
blacklight-spotlight-4.3.0 app/models/translation.rb
blacklight-spotlight-4.2.0 app/models/translation.rb
blacklight-spotlight-4.1.2 app/models/translation.rb
blacklight-spotlight-4.1.1 app/models/translation.rb
blacklight-spotlight-4.1.0 app/models/translation.rb
blacklight-spotlight-4.0.3 app/models/translation.rb
blacklight-spotlight-4.0.2 app/models/translation.rb
blacklight-spotlight-4.0.1 app/models/translation.rb
blacklight-spotlight-4.0.0 app/models/translation.rb
blacklight-spotlight-3.6.0.beta10 app/models/translation.rb
blacklight-spotlight-3.6.0.beta9 app/models/translation.rb
blacklight-spotlight-3.6.0.beta8 app/models/translation.rb
blacklight-spotlight-3.6.0.beta7 app/models/translation.rb
blacklight-spotlight-3.6.0.beta6 app/models/translation.rb