diff options
-rw-r--r-- | activerecord/lib/active_record.rb | 1 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
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) |