Permalink
Browse files

check active record defined in railtie

  • Loading branch information...
1 parent 9476bc4 commit e7615b7adf7b8705f79084ca61548633d36b9417 @kristianmandrup committed Aug 29, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/green_monkey/railtie.rb
@@ -5,8 +5,11 @@ class Railtie < Rails::Railtie
initializer 'green_monkey.init', :before => :load_config_initializers do
require "green_monkey/ext/active_model"
ActiveModel::Dirty.send :include, GreenMonkey::ModelHelpers
- ActiveRecord::Base.send :include, GreenMonkey::ModelHelpers
+ if defined?(ActiveRecord)
+ ActiveRecord::Base.send :include, GreenMonkey::ModelHelpers
+ end
+
require 'green_monkey/ext/view_helper'
ActionView::Base.send :include, GreenMonkey::ViewHelper

0 comments on commit e7615b7

Please sign in to comment.