Add the has_many_polymorphs plugin
[cs356-p2-videostore.git] / vendor / plugins / has_many_polymorphs / lib / has_many_polymorphs.rb
1
2 require 'active_record'
3
4 RAILS_DEFAULT_LOGGER = nil unless defined? RAILS_DEFAULT_LOGGER
5
6 require 'has_many_polymorphs/reflection'
7 require 'has_many_polymorphs/association'
8 require 'has_many_polymorphs/class_methods'
9
10 require 'has_many_polymorphs/support_methods'
11 require 'has_many_polymorphs/base'
12
13 class ActiveRecord::Base
14   extend ActiveRecord::Associations::PolymorphicClassMethods 
15 end
16
17 if ENV['HMP_DEBUG'] or ENV['RAILS_ENV'] =~ /development|test/ and ENV['USER'] == 'eweaver'
18   require 'has_many_polymorphs/debugging_tools' 
19 end
20
21 if defined? Rails and RAILS_ENV and RAILS_ROOT
22   _logger_warn "rails environment detected"
23   require 'has_many_polymorphs/configuration'
24   require 'has_many_polymorphs/dependencies'
25   require 'has_many_polymorphs/autoload'
26 end
27
28 _logger_debug "loaded ok"