Sha256: 9188e8f1986ef89b991217153556b83d24e37a8abd658e717438ccd13c5f7795

Contents?: true

Size: 398 Bytes

Versions: 1

Compression:

Stored size: 398 Bytes

Contents

# frozen_string_literal: true

module Maglev
  # Fetch the site and set up the Translatable available locales
  class FetchSite
    include Injectable

    def call
      @site ||= Maglev::Site.first.tap do |site|
        change_default_locales(site)
      end
    end

    private

    def change_default_locales(site)
      Maglev::I18n.available_locales = site.locale_prefixes
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maglevcms-1.6.0 app/services/maglev/fetch_site.rb