aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-06-02 12:29:09 -0300
committerEmilio Tagua <miloops@gmail.com>2009-06-02 12:29:09 -0300
commit2474fbb4d60f7431af34886f0dccecfe037c565f (patch)
tree23a4bd6c1fe6ead8a4b03048bf27b2d5ecfbc060 /activerecord
parentbbe51a1b9de7d3d825533dfee28968fed22acc0d (diff)
downloadrails-2474fbb4d60f7431af34886f0dccecfe037c565f.tar.gz
rails-2474fbb4d60f7431af34886f0dccecfe037c565f.tar.bz2
rails-2474fbb4d60f7431af34886f0dccecfe037c565f.zip
Set ActiveRecord as Arel engine on load.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record.rb1
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 05afd20f23..81fe921fd8 100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -77,4 +77,5 @@ module ActiveRecord
end
end
+Arel::Table.engine = Arel::Sql::Engine.new(ActiveRecord::Base)
I18n.load_path << File.dirname(__FILE__) + '/active_record/locale/en.yml'
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 81969d11c5..adc7f5335d 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1695,7 +1695,7 @@ module ActiveRecord #:nodoc:
end
def arel_table(table = table_name)
- @arel_table = Arel::Table.new(table, ActiveRecord::Base.connection)
+ @arel_table = Arel::Table.new(table)
end
def construct_finder_arel(options)
@@ -3062,7 +3062,7 @@ module ActiveRecord #:nodoc:
end
def arel_table
- @arel_table ||= Arel::Table.new(self.class.table_name, ActiveRecord::Base.connection)
+ @arel_table = Arel::Table.new(self.class.table_name)
end
def arel_attributes_values(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)