No need to reload the relation table with a method param, just nil it.

This commit is contained in:
Emilio Tagua
2009-08-27 16:49:16 -03:00
parent 53f6c6d24e
commit d56e987757

View File

@@ -1365,9 +1365,7 @@ module ActiveRecord #:nodoc:
# end
def reset_column_information
undefine_attribute_methods
# Reload ARel relation cached table
arel_table(table_name, true)
@column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @inheritance_column = nil
@arel_table = @column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @inheritance_column = nil
end
def reset_column_information_and_inheritable_attributes_for_all_subclasses#:nodoc:
@@ -1535,9 +1533,9 @@ module ActiveRecord #:nodoc:
end
def arel_table(table = nil, reload = nil)
def arel_table(table = nil)
table = table_name if table.blank?
if reload || @arel_table.nil? || @arel_table.name != table
if @arel_table.nil? || @arel_table.name != table
@arel_table = Relation.new(self, Arel::Table.new(table))
end
@arel_table