Sha256: c31f1958936f789d9a7101defbc07aad5976cd75011f554649ceeef0ed317ead

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 Bytes

Contents

require 'rails'
# ensure ORMs are loaded *before* initializing
begin; require 'mongoid'; rescue LoadError; end

require File.join(File.dirname(__FILE__), 'validators/bank_account_validator')

module KontoAPI
  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'kontoapi' do |app|
      ActiveSupport.on_load(:active_record) do
        require File.join(File.dirname(__FILE__), 'orm/active_record_extension')
        ::ActiveRecord::Base.send :include, KontoAPI::ActiveRecordExtension
      end
      if defined? ::Mongoid
        require File.join(File.dirname(__FILE__), 'orm/mongoid_extension')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kontoapi-rails-0.3.1 lib/kontoapi-rails/railtie.rb
kontoapi-rails-0.3.0 lib/kontoapi-rails/railtie.rb
kontoapi-rails-0.2.6 lib/kontoapi-rails/railtie.rb