Sha256: e07b3f79f1b361508725e0a5a1bd61cb4852795e17ee4b8800e7a8049ccd1562

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

module Blazer
  class Engine < ::Rails::Engine
    isolate_namespace Blazer

    initializer "blazer" do |app|
      # use a proc instead of a string
      app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }

      Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone
      Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true
      Blazer.user_name = Blazer.settings["user_name"] if Blazer.settings["user_name"]
      Blazer.from_email = Blazer.settings["from_email"] if Blazer.settings["from_email"]

      Blazer.user_class ||= Blazer.settings["user_class"] || User rescue nil
      Blazer::Query.belongs_to :creator, class_name: Blazer.user_class.to_s if Blazer.user_class
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blazer-1.0.0 lib/blazer/engine.rb