diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-01 22:31:27 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-01 22:31:27 -0300 |
commit | 41d72ce3724488dd406366e12e0b14cb366e98a3 (patch) | |
tree | 4ba008c5479dfb5920fd937b8736819ba2e024d6 /activesupport/lib/active_support | |
parent | ddd0a22133e3aff87f9a966af3ddf85c41f42d2e (diff) | |
download | rails-41d72ce3724488dd406366e12e0b14cb366e98a3.tar.gz rails-41d72ce3724488dd406366e12e0b14cb366e98a3.tar.bz2 rails-41d72ce3724488dd406366e12e0b14cb366e98a3.zip |
Remove conversion code for old Rails cache entry
This code was there just to convert entries generated in Rails
4.0.0.beta1 applications to a supported format.
It is almost unlikely that any existent application have this cache
entry format in their caches at the point that Rails 5 will be released
so we don't need this code anymore.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index d49cd7988f..dddd1e136e 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -615,14 +615,12 @@ module ActiveSupport end def value - convert_version_4beta1_entry! if defined?(@v) compressed? ? uncompress(@value) : @value end # Check if the entry is expired. The +expires_in+ parameter can override # the value set when the entry was created. def expired? - convert_version_4beta1_entry! if defined?(@v) @expires_in && @created_at + @expires_in <= Time.now.to_f end @@ -658,8 +656,6 @@ module ActiveSupport # Duplicate the value in a class. This is used by cache implementations that don't natively # serialize entries to protect against accidental cache modifications. def dup_value! - convert_version_4beta1_entry! if defined?(@v) - if @value && !compressed? && !(@value.is_a?(Numeric) || @value == true || @value == false) if @value.is_a?(String) @value = @value.dup @@ -692,26 +688,6 @@ module ActiveSupport def uncompress(value) Marshal.load(Zlib::Inflate.inflate(value)) end - - # The internals of this method changed between Rails 3.x and 4.0. This method provides the glue - # to ensure that cache entries created under the old version still work with the new class definition. - def convert_version_4beta1_entry! - if defined?(@v) - @value = @v - remove_instance_variable(:@v) - end - - if defined?(@c) - @compressed = @c - remove_instance_variable(:@c) - end - - if defined?(@x) && @x - @created_at ||= Time.now.to_f - @expires_in = @x - @created_at - remove_instance_variable(:@x) - end - end end end end |