1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Set ActiveRecord as Arel engine on load.

This commit is contained in:
Emilio Tagua 2009-06-02 12:29:09 -03:00
parent bbe51a1b9d
commit 2474fbb4d6
2 changed files with 3 additions and 2 deletions

View file

@ -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'

View file

@ -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)