Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for ActiveRecord::Base...

  • Loading branch information...
commit 490ef7917293765b254307e61adf0a8f1d5ba05b 1 parent b1c0e67
@ehoch authored
Showing with 7 additions and 0 deletions.
  1. +6 −0 lib/green_monkey.rb
  2. +1 −0  lib/green_monkey/railtie.rb
View
6 lib/green_monkey.rb
@@ -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'
View
1  lib/green_monkey/railtie.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.