aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-03 11:50:43 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-03 11:50:43 -0800
commitd65e3b481e72e8c76818a94353e9ac315c7c0272 (patch)
tree86b9cbbb97f342d9e5efa11128f3661fb5578739 /activerecord/lib/active_record/base.rb
parent1a15fda02159487371a0cb4c36311345dec7b46b (diff)
downloadrails-d65e3b481e72e8c76818a94353e9ac315c7c0272.tar.gz
rails-d65e3b481e72e8c76818a94353e9ac315c7c0272.tar.bz2
rails-d65e3b481e72e8c76818a94353e9ac315c7c0272.zip
ARel only requires the connection from the AR class. Simply return the AR class rather than jump through hoops and store ivars
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 8750e226b9..4e743ec826 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -747,7 +747,7 @@ module ActiveRecord #:nodoc:
undefine_attribute_methods
reset_column_cache
@column_names = @content_columns = @dynamic_methods_hash = @inheritance_column = nil
- @arel_engine = @relation = nil
+ @relation = nil
end
def reset_column_cache # :nodoc:
@@ -856,13 +856,7 @@ module ActiveRecord #:nodoc:
end
def arel_engine
- @arel_engine ||= begin
- if self == ActiveRecord::Base
- ActiveRecord::Base
- else
- connection_handler.connection_pools[name] ? self : superclass.arel_engine
- end
- end
+ self
end
# Returns a scope for this class without taking into account the default_scope.