diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-27 16:42:57 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-27 16:42:57 -0300 |
commit | e204f80dbb2134867b006d02c4d5d15c265351b8 (patch) | |
tree | 38f48d54291fa74bb824e9d2478bcfc5cd3c9b93 /activerecord | |
parent | 1cc0ea826e92169575b486e662dff1e1d44db992 (diff) | |
download | rails-e204f80dbb2134867b006d02c4d5d15c265351b8.tar.gz rails-e204f80dbb2134867b006d02c4d5d15c265351b8.tar.bz2 rails-e204f80dbb2134867b006d02c4d5d15c265351b8.zip |
Performance: Don't reload the ARel relation on create, do it on
reset_column_information.
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 0307aa29d3..4e2261d044 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1365,6 +1365,8 @@ 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 end @@ -2877,8 +2879,6 @@ module ActiveRecord #:nodoc: self.id = connection.next_sequence_value(self.class.sequence_name) end - # Reload ARel relation cached table - self.class.arel_table(self.class.table_name, true) attributes_values = arel_attributes_values new_id = if attributes_values.empty? |