Permalink
Browse files

Merge pull request #7 from ehoch/master

ActiveRecord::Base support
  • Loading branch information...
2 parents b1c0e67 + 490ef79 commit 76da7e2946741917597718fdc0e01a14f92dd164 @Paxa 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 76da7e2

Please sign in to comment.