diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/integration.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/integration.rb b/activerecord/lib/active_record/integration.rb index db7200bceb..04d0d46d3e 100644 --- a/activerecord/lib/active_record/integration.rb +++ b/activerecord/lib/active_record/integration.rb @@ -193,9 +193,8 @@ module ActiveRecord # to account for this we pad the output with zeros def raw_timestamp_to_cache_version(timestamp) key = timestamp.delete("- :.") - padding = 20 - key.length - if padding != 0 - key << "0" * padding + if key.length < 20 + key.ljust(20, "0") else key end |