From aef6acc583db0fdcee0d82bf89b2cf489a84d8f5 Mon Sep 17 00:00:00 2001 From: Cory Schires Date: Fri, 4 Nov 2011 10:27:13 -0500 Subject: [PATCH] Move AR include into engine file. --- app/models/impressionist/impressionable.rb | 2 -- lib/impressionist/engine.rb | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/impressionist/impressionable.rb b/app/models/impressionist/impressionable.rb index 4562af2..9b5d650 100644 --- a/app/models/impressionist/impressionable.rb +++ b/app/models/impressionist/impressionable.rb @@ -69,5 +69,3 @@ module Impressionist end end - -ActiveRecord::Base.send(:include, Impressionist::Impressionable) diff --git a/lib/impressionist/engine.rb b/lib/impressionist/engine.rb index ffa1244..295fcf2 100644 --- a/lib/impressionist/engine.rb +++ b/lib/impressionist/engine.rb @@ -2,11 +2,11 @@ require "impressionist" require "rails" module Impressionist - class Engine < Rails::Engine + class Engine < Rails::Engine initializer 'impressionist.extend_ar' do |app| - ActiveRecord::Base.extend Impressionist::Impressionable + ActiveRecord::Base.send(:include, Impressionist::Impressionable) end - + initializer 'impressionist.controller' do ActiveSupport.on_load(:action_controller) do include ImpressionistController::InstanceMethods