Sha256: f5acee0d5cabcbeb901c6e944f4b83ef501d065978420ff7464654d1a974db15

Contents?: true

Size: 448 Bytes

Versions: 21

Compression:

Stored size: 448 Bytes

Contents

require 'rolify'
require 'rails'

module Rolify
  class Railtie < Rails::Railtie
    initializer 'rolify.initialize' do
      ActiveSupport.on_load(:active_record) do
        ActiveRecord::Base.send :extend, Rolify
      end
      
      config.before_initialize do
        ::Mongoid::Document.module_eval do
          def self.included(base)
            base.extend Rolify
          end
        end
      end if defined?(Mongoid)
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
rolify-3.2.0.rc2 lib/rolify/railtie.rb