Sha256: 8319f923715cbc406157af2b7123345a76e46e5f715d0ddb5d6c51943c091ee7

Contents?: true

Size: 490 Bytes

Versions: 107

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Admin
    module CurrentLanguage
      extend ActiveSupport::Concern

      included do
        before_action :load_current_language
      end

      private

      def load_current_language
        @current_language = Alchemy::Language.current
        if @current_language.nil?
          flash[:warning] = Alchemy.t("Please create a language first.")
          redirect_to admin_languages_path
        end
      end
    end
  end
end

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.3 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.2 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.1 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.0 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.0.pre.rc1 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.0.pre.b2 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.1.0.pre.b1 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.8 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.7 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.6 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.5 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.4 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.3 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-6.1.9 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.2 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-6.1.8 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-6.1.7 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.1 app/controllers/concerns/alchemy/admin/current_language.rb
alchemy_cms-7.0.0 app/controllers/concerns/alchemy/admin/current_language.rb