2004-11-23 20:04:44 -05:00
|
|
|
#--
|
2007-09-09 13:57:16 -04:00
|
|
|
# Copyright (c) 2004-2007 David Heinemeier Hansson
|
2004-11-23 20:04:44 -05:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
#++
|
|
|
|
|
2005-09-15 01:34:59 -04:00
|
|
|
$:.unshift(File.dirname(__FILE__)) unless
|
|
|
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2007-10-07 01:25:36 -04:00
|
|
|
unless defined? ActiveSupport
|
|
|
|
active_support_path = File.dirname(__FILE__) + "/../../activesupport/lib"
|
|
|
|
if File.exist?(active_support_path)
|
|
|
|
$:.unshift active_support_path
|
|
|
|
require 'active_support'
|
|
|
|
else
|
2005-09-15 01:34:59 -04:00
|
|
|
require 'rubygems'
|
2007-02-04 15:44:45 -05:00
|
|
|
gem 'activesupport'
|
2007-10-07 01:25:36 -04:00
|
|
|
require 'active_support'
|
2005-09-15 01:34:59 -04:00
|
|
|
end
|
2005-02-15 10:57:44 -05:00
|
|
|
end
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
require 'active_record/base'
|
2008-03-23 22:50:02 -04:00
|
|
|
require 'active_record/named_scope'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'active_record/observer'
|
2007-09-17 02:15:58 -04:00
|
|
|
require 'active_record/query_cache'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'active_record/validations'
|
|
|
|
require 'active_record/callbacks'
|
2005-12-02 23:29:55 -05:00
|
|
|
require 'active_record/reflection'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'active_record/associations'
|
2008-01-18 23:19:53 -05:00
|
|
|
require 'active_record/association_preload'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'active_record/aggregations'
|
|
|
|
require 'active_record/transactions'
|
2004-12-15 21:49:18 -05:00
|
|
|
require 'active_record/timestamp'
|
2006-06-19 21:58:36 -04:00
|
|
|
require 'active_record/locking/optimistic'
|
|
|
|
require 'active_record/locking/pessimistic'
|
2005-03-01 09:27:32 -05:00
|
|
|
require 'active_record/migration'
|
2005-09-24 13:50:07 -04:00
|
|
|
require 'active_record/schema'
|
2006-02-25 18:06:04 -05:00
|
|
|
require 'active_record/calculations'
|
2007-09-20 19:22:30 -04:00
|
|
|
require 'active_record/serialization'
|
2006-07-30 23:43:03 -04:00
|
|
|
require 'active_record/attribute_methods'
|
2008-03-28 20:04:27 -04:00
|
|
|
require 'active_record/dirty'
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
ActiveRecord::Base.class_eval do
|
2007-09-17 02:15:58 -04:00
|
|
|
extend ActiveRecord::QueryCache
|
2004-11-23 20:04:44 -05:00
|
|
|
include ActiveRecord::Validations
|
2006-06-19 21:58:27 -04:00
|
|
|
include ActiveRecord::Locking::Optimistic
|
2006-06-19 21:58:36 -04:00
|
|
|
include ActiveRecord::Locking::Pessimistic
|
2008-03-30 21:49:57 -04:00
|
|
|
include ActiveRecord::AttributeMethods
|
|
|
|
include ActiveRecord::Dirty
|
2005-06-11 06:06:47 -04:00
|
|
|
include ActiveRecord::Callbacks
|
2005-09-25 04:26:29 -04:00
|
|
|
include ActiveRecord::Observing
|
2004-12-31 14:38:04 -05:00
|
|
|
include ActiveRecord::Timestamp
|
2004-11-23 20:04:44 -05:00
|
|
|
include ActiveRecord::Associations
|
2008-03-23 22:50:02 -04:00
|
|
|
include ActiveRecord::NamedScope
|
2008-01-18 23:19:53 -05:00
|
|
|
include ActiveRecord::AssociationPreload
|
2004-11-23 20:04:44 -05:00
|
|
|
include ActiveRecord::Aggregations
|
|
|
|
include ActiveRecord::Transactions
|
|
|
|
include ActiveRecord::Reflection
|
2006-02-25 18:06:04 -05:00
|
|
|
include ActiveRecord::Calculations
|
2007-09-20 19:22:30 -04:00
|
|
|
include ActiveRecord::Serialization
|
2004-11-23 20:04:44 -05:00
|
|
|
end
|
|
|
|
|
2007-05-24 23:19:35 -04:00
|
|
|
require 'active_record/connection_adapters/abstract_adapter'
|
2005-05-02 03:04:20 -04:00
|
|
|
|
2005-12-24 12:31:26 -05:00
|
|
|
require 'active_record/schema_dumper'
|