Sha256: 598c7afe87b2b2c2d0fa05fd79db6fa71f8a20e248538047aa1ea441c70dc02f

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 KB

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module FatFreeCRM
  class Engine < ::Rails::Engine
    config.autoload_paths += Dir[root.join("app/models/**")] +
                             Dir[root.join("app/controllers/entities")]

    config.active_record.observers = %i[lead_observer opportunity_observer
                                        task_observer entity_observer]

    initializer "model_core.factories", after: "factory_girl.set_factory_paths" do
      FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl)
    end

    initializer :append_migrations do |app|
      unless app.root.to_s == root.to_s
        config.paths["db/migrate"].expanded.each do |expanded_path|
          app.config.paths["db/migrate"] << expanded_path
        end
      end
    end

    config.to_prepare do
      Dir.glob(Rails.root + "app/decorators/**/*_decorator*.rb").each do |c|
        require_dependency(c)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fat_free_crm-0.15.2 lib/fat_free_crm/engine.rb
fat_free_crm-0.16.4 lib/fat_free_crm/engine.rb
fat_free_crm-0.15.1 lib/fat_free_crm/engine.rb
fat_free_crm-0.16.3 lib/fat_free_crm/engine.rb
fat_free_crm-0.16.2 lib/fat_free_crm/engine.rb
fat_free_crm-0.16.1 lib/fat_free_crm/engine.rb
fat_free_crm-0.16.0 lib/fat_free_crm/engine.rb
fat_free_crm-0.15.0 lib/fat_free_crm/engine.rb