Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed #5845

  • Loading branch information...
commit 0b1fb51462e955029e02ee2fb0ee9084ef01bb8b 1 parent efa9a1f
angelo giovanni capilleri authored
View
4 activerecord/lib/active_record/integration.rb
@@ -33,13 +33,13 @@ def to_param
#
# Product.new.cache_key # => "products/new"
# Product.find(5).cache_key # => "products/5" (updated_at not available)
- # Person.find(5).cache_key # => "people/5-20071224150000" (updated_at available)
+ # # Person.find(5).cache_key # => "people/5-1334398193-832774" (updated_at available)
def cache_key
case
when new_record?
"#{self.class.model_name.cache_key}/new"
when timestamp = self[:updated_at]
- timestamp = timestamp.utc.to_s(:number)
+ timestamp = timestamp.utc.to_f.gsub(/\./,'-')
"#{self.class.model_name.cache_key}/#{id}-#{timestamp}"
else
"#{self.class.model_name.cache_key}/#{id}"
View
2  activerecord/test/cases/base_test.rb
@@ -2113,7 +2113,7 @@ def test_cache_key_for_existing_record_is_not_timezone_dependent
def test_cache_key_format_for_existing_record_with_updated_at
dev = Developer.first
- assert_equal "developers/#{dev.id}-#{dev.updated_at.utc.to_s(:number)}", dev.cache_key
+ assert_equal "developers/#{dev.id}-#{dev.updated_at.utc.to_f.gsub(/\./,'-')}", dev.cache_key
end
def test_cache_key_format_for_existing_record_with_nil_updated_at
Please sign in to comment.
Something went wrong with that request. Please try again.