Sha256: 288507dfcf32359762f248a79a86ffb5430be176cd0ab40cc404a7d25f6d9a86

Contents?: true

Size: 1.34 KB

Versions: 18

Compression:

Stored size: 1.34 KB

Contents

module Enjoy
  class Engine < ::Rails::Engine
    isolate_namespace Enjoy

    rake_tasks do
      require File.expand_path('../tasks', __FILE__)
    end

    initializer "enjoy_cms.email_defaults" do
      # Write default email settings to DB so they can be changed.

      #temp
      begin
        if Settings.table_exists?
          Settings.default_email_from(default: 'noreply@site.domain')
          Settings.form_email(default: 'admin@site.domain')
          Settings.email_topic(default: 'с сайта')
        end
      rescue
      end
    end
    initializer 'enjoy_cms.paperclip' do
      require 'paperclip/style'
      module ::Paperclip
        class Style
          alias_method :processor_options_without_auto_orient, :processor_options
          def processor_options
            processor_options_without_auto_orient.merge(auto_orient: false)
          end
        end
      end
    end

    config.after_initialize do
      # trigger autoload so models are registered in Mongoid::Elasticearch
      Enjoy.config.search_models.map(&:constantize)

      # Write default email settings to DB so they can be changed.
      if Settings.table_exists?
        Settings.default_email_from(default: 'noreply@site.domain')
        Settings.form_email(default: 'admin@site.domain')
        Settings.email_topic(default: 'с сайта')
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
enjoy_cms-0.3.4 lib/enjoy/engine.rb
enjoy_cms-0.3.3 lib/enjoy/engine.rb
enjoy_cms-0.3.2.1 lib/enjoy/engine.rb
enjoy_cms-0.3.2 lib/enjoy/engine.rb
enjoy_cms-0.3.1.2 lib/enjoy/engine.rb
enjoy_cms-0.3.1.1 lib/enjoy/engine.rb
enjoy_cms-0.3.1 lib/enjoy/engine.rb
enjoy_cms-0.3.0.4 lib/enjoy/engine.rb
enjoy_cms-0.3.0.3 lib/enjoy/engine.rb
enjoy_cms-0.3.0.2 lib/enjoy/engine.rb
enjoy_cms-0.2.1 lib/enjoy/engine.rb
enjoy_cms-0.2.0.3.2 lib/enjoy/engine.rb
enjoy_cms-0.2.0.3.1 lib/enjoy/engine.rb
enjoy_cms-0.2.0.3 lib/enjoy/engine.rb
enjoy_cms-0.2.0.2 lib/enjoy/engine.rb
enjoy_cms-0.2.0.1.beta lib/enjoy/engine.rb
enjoy_cms-0.2.0.beta lib/enjoy/engine.rb
enjoy_cms-0.1.0.beta1 lib/enjoy/engine.rb