Sha256: 4544b6ef1656ad141f52a0301d23b4be7a299dc975612f09ed3af0faad4ab7d1

Contents?: true

Size: 659 Bytes

Versions: 18

Compression:

Stored size: 659 Bytes

Contents

require 'polyblock/view_helpers'
require 'polyblock/glue'

module Polyblock
  require 'rails'

  class Railtie < Rails::Railtie
    initializer "polyblock.insert_into_active_record" do |app|
      ActiveSupport.on_load :active_record do
        Polyblock::Railtie.insert
      end
    end

    initializer "polyblock.view_helpers" do
      ActionView::Base.send :include, ViewHelpers
    end
    # initializer "polyblock.capybara_helpers" do
    #   RSpec.send :include, CapybaraHelpers
    # end
  end

  class Railtie
    def self.insert
      if defined?(ActiveRecord)
        ActiveRecord::Base.send(:include, Polyblock::Glue)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
polyblock-1.1.1 lib/polyblock/railtie.rb
polyblock-1.1.0 lib/polyblock/railtie.rb
polyblock-1.0.8 lib/polyblock/railtie.rb
polyblock-1.0.7 lib/polyblock/railtie.rb
polyblock-1.0.6 lib/polyblock/railtie.rb
polyblock-1.0.5 lib/polyblock/railtie.rb
polyblock-1.0.4 lib/polyblock/railtie.rb
polyblock-1.0.3 lib/polyblock/railtie.rb
polyblock-1.0.2 lib/polyblock/railtie.rb
polyblock-1.0.1 lib/polyblock/railtie.rb
polyblock-1.0.0 lib/polyblock/railtie.rb
polyblock-0.9.9 lib/polyblock/railtie.rb
polyblock-0.9.8 lib/polyblock/railtie.rb
polyblock-0.9.7 lib/polyblock/railtie.rb
polyblock-0.9.6 lib/polyblock/railtie.rb
polyblock-0.9.5 lib/polyblock/railtie.rb
polyblock-0.9.4 lib/polyblock/railtie.rb
polyblock-0.9.3 lib/polyblock/railtie.rb