lib/saulabs/reportable/railtie.rb in reportable-1.1.2 vs lib/saulabs/reportable/railtie.rb in reportable-1.2.0
- old
+ new
@@ -1,6 +1,7 @@
require 'saulabs/reportable'
+require 'saulabs/reportable/report_tag_helper'
require 'rails'
module Saulabs
module Reportable
@@ -8,10 +9,20 @@
class Railtie < Rails::Railtie
GEM_ROOT = File.join(File.dirname(__FILE__), '..', '..', '..')
initializer 'saulabs.reportable.initialization' do
- require File.join(GEM_ROOT, 'rails', 'init')
+ ActiveSupport.on_load :active_record do
+ ActiveRecord::Base.class_eval do
+ include Saulabs::Reportable::RailsAdapter
+ end
+ end
+ ActiveSupport.on_load :action_view do
+ ActionView::Base.class_eval do
+ include Saulabs::Reportable::ReportTagHelper
+ end
+ end
+
end
generators do
require File.join(GEM_ROOT, 'generators', 'reportable_migration', 'reportable_migration_generator')
require File.join(GEM_ROOT, 'generators', 'reportable_raphael_assets', 'reportable_raphael_assets_generator')