aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/integration.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-11-04 13:06:53 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-11-04 13:11:51 -0200
commit92c6305954956cd845ebb89f4e1e44522e20a7c1 (patch)
treeca0e5c8452fd5505936140b4d4a0bb850af95917 /activerecord/lib/active_record/integration.rb
parent91d72fe6529ad8dc157542a955c7e58d0f9d53e6 (diff)
downloadrails-92c6305954956cd845ebb89f4e1e44522e20a7c1.tar.gz
rails-92c6305954956cd845ebb89f4e1e44522e20a7c1.tar.bz2
rails-92c6305954956cd845ebb89f4e1e44522e20a7c1.zip
Respect cache timestamp format when giving timestamps to #cache_key
Diffstat (limited to 'activerecord/lib/active_record/integration.rb')
-rw-r--r--activerecord/lib/active_record/integration.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/integration.rb b/activerecord/lib/active_record/integration.rb
index 2b275a2ed9..94abdb3ec7 100644
--- a/activerecord/lib/active_record/integration.rb
+++ b/activerecord/lib/active_record/integration.rb
@@ -56,7 +56,8 @@ module ActiveRecord
"#{self.class.model_name.cache_key}/new"
when timestamp_names.any?
timestamps = timestamp_names.collect { |method| send(method) }.compact
- "#{self.class.model_name.cache_key}/#{id}-#{timestamps.max.utc.to_s(:number)}"
+ timestamp = timestamps.max.utc.to_s(cache_timestamp_format)
+ "#{self.class.model_name.cache_key}/#{id}-#{timestamp}"
when timestamp = max_updated_column_timestamp
timestamp = timestamp.utc.to_s(cache_timestamp_format)
"#{self.class.model_name.cache_key}/#{id}-#{timestamp}"