From d56e987757923fa28ae90cf269707b78b744d66d Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Thu, 27 Aug 2009 16:49:16 -0300 Subject: No need to reload the relation table with a method param, just nil it. --- activerecord/lib/active_record/base.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 2fc7b1e9c6..c11c049415 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -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 -- cgit v1.2.3