Sha256: 3a7f75a5328e8b1a9a589d4b6bff782b890a704b6a89770263cc9afe5c4a2afb

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

require 'saulabs/reportable'
require 'saulabs/reportable/report_tag_helper'
require 'rails'

module Saulabs

  module Reportable

    class Railtie < Rails::Railtie

      GEM_ROOT = File.join(File.dirname(__FILE__), '..', '..', '..')

      initializer 'saulabs.reportable.initialization' do
        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, 'lib', 'generators', 'reportable_migration', 'reportable_migration_generator')
        require File.join(GEM_ROOT, 'lib', 'generators', 'reportable_model_name_migration', 'reportable_model_name_migration_generator')
        require File.join(GEM_ROOT, 'lib', 'generators', 'reportable_raphael_assets', 'reportable_raphael_assets_generator')
        require File.join(GEM_ROOT, 'lib', 'generators', 'reportable_jquery_flot_assets', 'reportable_jquery_flot_assets_generator')
      end

    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reportable-1.4.2 lib/saulabs/reportable/railtie.rb
reportable-1.4.1 lib/saulabs/reportable/railtie.rb
reportable-1.4.0 lib/saulabs/reportable/railtie.rb