aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-07 11:28:11 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-07 11:28:11 -0800
commit839f3bf6822ed3698df1e606c4215d650312f33e (patch)
tree1f53277c77c8b64679f9bfda1e184a0c4ce91730 /activerecord/lib/active_record/base.rb
parent8a1c5337808c53c5e9d2d842a09a90599c497e89 (diff)
downloadrails-839f3bf6822ed3698df1e606c4215d650312f33e.tar.gz
rails-839f3bf6822ed3698df1e606c4215d650312f33e.tar.bz2
rails-839f3bf6822ed3698df1e606c4215d650312f33e.zip
just use a hash for doing association caching
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index d3a739b98b..f32132b18a 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1368,6 +1368,7 @@ MSG
# hence you can't have attributes that aren't part of the table columns.
def initialize(attributes = nil)
@attributes = attributes_from_column_definition
+ @association_cache = {}
@attributes_cache = {}
@new_record = true
@readonly = false
@@ -1415,6 +1416,7 @@ MSG
def init_with(coder)
@attributes = coder['attributes']
@attributes_cache, @previously_changed, @changed_attributes = {}, {}, {}
+ @association_cache = {}
@readonly = @destroyed = @marked_for_destruction = false
@new_record = false
_run_find_callbacks
@@ -1627,8 +1629,9 @@ MSG
end
clear_aggregation_cache
- clear_association_cache
- @attributes_cache = {}
+
+ @association_cache = {}
+ @attributes_cache = {}
@new_record = true
ensure_proper_type