3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/money-rails/hooks.rb', line 3
def self.init
ActiveSupport.on_load(:active_record) do
require 'money-rails/active_model/validator'
require 'money-rails/active_record/monetizable'
::ActiveRecord::Base.send :include, MoneyRails::ActiveRecord::Monetizable
end
begin; require 'mongoid'; require 'mongoid/version'; rescue LoadError; end
if defined? ::Mongoid
if ::Mongoid::VERSION =~ /^2(.*)/
require 'money-rails/mongoid/two' end
if ::Mongoid::VERSION =~ /^3(.*)/
require 'money-rails/mongoid/three'
end
end
ActiveSupport.on_load(:action_view) do
require 'money-rails/helpers/action_view_extension'
::ActionView::Base.send :include, MoneyRails::ActionViewExtension
end
end
|