Permalink
Browse files

Add support for ActiveRecord::Base...

  • Loading branch information...
1 parent b1c0e67 commit 490ef7917293765b254307e61adf0a8f1d5ba05b @ehoch committed Apr 23, 2012
Showing with 7 additions and 0 deletions.
  1. +6 −0 lib/green_monkey.rb
  2. +1 −0 lib/green_monkey/railtie.rb
View
@@ -10,6 +10,12 @@ module GreenMonkey
ActiveModel::Dirty.send :include, GreenMonkey::ModelHelpers
end
+ if defined? ActiveRecord
+ require "green_monkey/ext/active_model"
+ ActiveRecord::Base.send :include, GreenMonkey::ModelHelpers
+ end
+
+
if defined? ActionView
require "green_monkey/ext/action_view"
require 'green_monkey/ext/view_helper'
@@ -5,6 +5,7 @@ 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
require 'green_monkey/ext/view_helper'
ActionView::Base.send :include, GreenMonkey::ViewHelper

0 comments on commit 490ef79

Please sign in to comment.