aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-03 15:35:34 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-03 15:35:44 -0800
commit7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd (patch)
treec0febaa28f316ba99e57a0899d316dc5e57f85d5 /activerecord/lib/active_record/base.rb
parent082326deb5ba7e78d4a51ef6b8783d668066ed23 (diff)
downloadrails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.tar.gz
rails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.tar.bz2
rails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.zip
allow AR caches to be cleared, clear them on class reloading
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 8750e226b9..f8ae855e28 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -750,6 +750,12 @@ module ActiveRecord #:nodoc:
@arel_engine = @relation = nil
end
+ def clear_cache! # :nodoc:
+ @@columns.clear
+ @@columns_hash.clear
+ @@arel_tables.clear
+ end
+
def reset_column_cache # :nodoc:
@@columns.delete table_name
@@columns_hash.delete table_name