Sha256: e1ad635308404492daad99cb92932af16b68e5e49e142820cd3dd7088e75aa86

Contents?: true

Size: 361 Bytes

Versions: 6

Compression:

Stored size: 361 Bytes

Contents

module NoCms
  module Blocks
    module Concerns
      module TranslationScopes
        extend ActiveSupport::Concern

        included do
          scope :where_with_locale, ->(where_params, locale = ::I18n.locale) {
            with_translations(locale).where(self::Translation.table_name => where_params)
          }
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nocms-blocks-1.2.0 app/models/no_cms/blocks/concerns/translation_scopes.rb
nocms-blocks-1.1.3 app/models/no_cms/blocks/concerns/translation_scopes.rb
nocms-blocks-1.1.2 app/models/no_cms/blocks/concerns/translation_scopes.rb
nocms-blocks-1.1.1 app/models/no_cms/blocks/concerns/translation_scopes.rb
nocms-blocks-1.1.0 app/models/no_cms/blocks/concerns/translation_scopes.rb
nocms-blocks-1.0.0 app/models/no_cms/blocks/concerns/translation_scopes.rb