Sha256: 85cbc89e9e5493aa79c5a1db53ed4db930638b086ff98d2a314162a8263292dc

Contents?: true

Size: 995 Bytes

Versions: 1

Compression:

Stored size: 995 Bytes

Contents

require "impressionist"
require "rails"

module Impressionist
  class Engine < Rails::Engine
    initializer 'impressionist.model' do |app|
      require "#{root}/app/models/impressionist/impressionable.rb"
      if Impressionist.orm == :active_record
        require "impressionist/models/active_record/impression.rb"
        require "impressionist/models/active_record/impressionist/impressionable.rb"
        ActiveRecord::Base.send(:include, Impressionist::Impressionable)
      elsif Impressionist.orm == :mongo_mapper
        require "impressionist/models/mongo_mapper/impression.rb"
        require "impressionist/models/mongo_mapper/impressionist/impressionable.rb"
        MongoMapper::Document.plugin Impressionist::Impressionable
      end
    end

    initializer 'impressionist.controller' do
      ActiveSupport.on_load(:action_controller) do
        include ImpressionistController::InstanceMethods
        extend ImpressionistController::ClassMethods
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
impressionist-1.1.1 lib/impressionist/engine.rb