Browse files

Fixed default ActiveRecord setting preventing generator from running.

  • Loading branch information...
1 parent 7ab364c commit a53363d9f63daaed2adc6e9ea9c12989feefe709 @jgwmaxwell committed Jul 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/impressionist/engine.rb
2 lib/impressionist/engine.rb
@@ -5,7 +5,7 @@ module Impressionist
class Engine < Rails::Engine
initializer 'impressionist.model' do |app|
require "#{root}/app/models/impressionist/impressionable.rb"
- if Impressionist.orm == :active_record
+ if Impressionist.orm == :active_record && defined? ActiveRecord
jgwmaxwell Jul 11, 2012 Owner

The default setting of pre-selecting ActiveRecord causes generators to fail on the

ActiveRecord::Base,send(:include, Impressionist::Impressionable)

line. Checking for it being defined beforehand allows apps generated with -O (skip AR) to still run the generators.

require "impressionist/models/active_record/impression.rb"
require "impressionist/models/active_record/impressionist/impressionable.rb"
ActiveRecord::Base.send(:include, Impressionist::Impressionable)

0 comments on commit a53363d

Please sign in to comment.