Sha256: b5aac33ec55c84e7da6b5c0dc7f63c916832856552624a03ff6c9a13d15e00f3

Contents?: true

Size: 893 Bytes

Versions: 8

Compression:

Stored size: 893 Bytes

Contents

require 'rails'

module Imaginable
  
  class Railtie < Rails::Railtie
    
    initializer 'imaginable' do |app|
      
      ActiveSupport.on_load(:active_record) do
        require 'imaginable/model'
        require 'imaginable/schema'
        ::ActiveRecord::Base.send(:extend, Imaginable::Model)
        ::ActiveRecord::ConnectionAdapters::Table.send(:include, Imaginable::Schema)
        ::ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Imaginable::Schema)
      end
      
      ActiveSupport.on_load(:action_view) do
        require 'imaginable/form_builder'
        require 'imaginable/helpers'
        ::ActionView::Base.send(:include, Imaginable::Helpers)
        ::ActionView::Helpers::FormBuilder.send(:include, Imaginable::FormBuilder)
        ::ActionView::Helpers::InstanceTag.send(:include, Imaginable::InstanceTag)
      end
      
    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
imaginable-0.1.6 lib/imaginable/railtie.rb
imaginable-0.1.5 lib/imaginable/railtie.rb
imaginable-0.1.4 lib/imaginable/railtie.rb
imaginable-0.1.3 lib/imaginable/railtie.rb
imaginable-0.1.2 lib/imaginable/railtie.rb
imaginable-0.1.1 lib/imaginable/railtie.rb
imaginable-0.1.0 lib/imaginable/railtie.rb
imaginable-0.0.5 lib/imaginable/railtie.rb