Sha256: 6b18561e279502855d73da4bf6cc0f3d87f28128bff4d4463eab00cbe763b7eb

Contents?: true

Size: 595 Bytes

Versions: 5

Compression:

Stored size: 595 Bytes

Contents

module Alchemy
  module ConfigurationMethods
    extend ActiveSupport::Concern

    included do
      helper_method :configuration, :multi_language?, :multi_site?
    end

    # Returns the configuration value of given key.
    #
    # Config file is in +config/alchemy/config.yml+
    #
    def configuration(name)
      Config.get(name)
    end

    # Returns true if more than one language is published.
    #
    def multi_language?
      Language.published.count > 1
    end

    # Returns true if more than one site exists.
    #
    def multi_site?
      Site.count > 1
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 lib/alchemy/configuration_methods.rb
lc_alchemy_cms-3.2.1 lib/alchemy/configuration_methods.rb
lc_alchemy_cms-3.2.0 lib/alchemy/configuration_methods.rb
alchemy_cms-3.2.0 lib/alchemy/configuration_methods.rb
alchemy_cms-3.2.0.rc1 lib/alchemy/configuration_methods.rb