Sha256: 848473ebb2df9c127bcb719899f624fc47d78d1deff5dca49c0b49ce7af40872

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

require "surrounded/rails/version"
require "surrounded"
require "rails"
module Surrounded
  class Railtie < ::Rails::Railtie
    if defined?(ActiveRecord)
      initializer 'surrounded.active_record' do |app|
        ActiveRecord::Base.send(:include, Surrounded)
      end
    end

    if defined?(Mongoid)
      initializer 'surrounded.mongoid' do |app|
        Mongoid::Document.send(:include, Surrounded)
      end
    end

    initializer 'surrounded.action_controller' do |app|
      ActionController::Base.send(:include, Surrounded)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
surrounded-rails-0.2.1 lib/surrounded/railtie.rb