Sha256: 0a6e7ac079b47a458af6570acb4aa6928ef9767b18e4012efe14bfb435f90357

Contents?: true

Size: 508 Bytes

Versions: 13

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true

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

13 entries across 13 versions & 1 rubygems

Version Path
blacklight-spotlight-3.5.0.4 app/models/translation.rb
blacklight-spotlight-3.5.0.3 app/models/translation.rb
blacklight-spotlight-3.5.0.2 app/models/translation.rb
blacklight-spotlight-3.5.0.1 app/models/translation.rb
blacklight-spotlight-3.5.0 app/models/translation.rb
blacklight-spotlight-3.4.4.1 app/models/translation.rb
blacklight-spotlight-3.4.4 app/models/translation.rb
blacklight-spotlight-3.4.3 app/models/translation.rb
blacklight-spotlight-3.4.2.2 app/models/translation.rb
blacklight-spotlight-3.4.2.1 app/models/translation.rb
blacklight-spotlight-3.4.2 app/models/translation.rb
blacklight-spotlight-3.4.1 app/models/translation.rb
blacklight-spotlight-3.4.0 app/models/translation.rb