lib/green_monkey/railtie.rb in green_monkey-0.1.4 vs lib/green_monkey/railtie.rb in green_monkey-0.2.2
- old
+ new
@@ -3,10 +3,13 @@
module GreenMonkey
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
require "green_monkey/ext/action_view"
\ No newline at end of file