fastentry 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d7172959be1badc7089c1f1dacb603666d8a66609653aec0a4e8f4ed5a9a869
4
- data.tar.gz: d47ef8ddc244d16fe5e06099d5c99864bec5403fc018ca3aa0936c9dff01e147
3
+ metadata.gz: 7db1335e41d587e0fb35535f44f14b034583e93b00aa2c74911f27ede92242fd
4
+ data.tar.gz: 304bbbd821a39fcff2e7bb8ad8d1a93b32921ee5a9050e8866d293f85717a38c
5
5
  SHA512:
6
- metadata.gz: 33fc43236765091c4185883ad7d3f125b89f037da7e1cac6f613cf84c3cc1e31943e93b1cc95f75f4bac92e98f0342b6885e86d8c58ab679b7d36547c9beb2eb
7
- data.tar.gz: b7b2d1674257804e0360ae7008e61915fe7c8677b87d63d0149b9a2801dd660d2f4758a41a2108d97dcf1b185a0e74e34304064fc8354ec6328f31a966ea20be
6
+ metadata.gz: 8958e93c3bd9dff0dfbf11beff8dd5a50879900bad13230cb48da86f5d2979812c00e373e2649b945928df48ef158988c704a31eb4391b304587dc671f983996
7
+ data.tar.gz: 6c7dd46799df6e69eb160535667aeee37f38718e2617dbe9b56c28fc444cb06e427a854869b62b840a6fe6defbe810e67396680be41d214249dda742f853eb0b
@@ -13,7 +13,7 @@ module Fastentry
13
13
  key = params[:key]
14
14
  Fastentry.cache.delete(key)
15
15
 
16
- redirect_back(fallback_location: root_path)
16
+ redirect_to root_path
17
17
  end
18
18
 
19
19
  def invalidate_multiple
@@ -22,7 +22,7 @@ module Fastentry
22
22
  Fastentry.cache.delete(key)
23
23
  end
24
24
 
25
- redirect_back(fallback_location: root_path)
25
+ redirect_to root_path
26
26
  end
27
27
  end
28
28
  end
data/lib/fastentry.rb CHANGED
@@ -20,15 +20,17 @@ module Fastentry
20
20
 
21
21
  def self.for(cache)
22
22
  if ::Rails::VERSION::MAJOR >= 5
23
- case cache
24
- when ActiveSupport::Cache::Strategy::LocalCache
23
+ # Comparing cache name due to class require statements:
24
+ ## ex. https://github.com/rails/rails/blob/94b5cd3a20edadd6f6b8cf0bdf1a4d4919df86cb/activesupport/lib/active_support/cache/redis_cache_store.rb#L5
25
+ case cache.class.name
26
+ when "ActiveSupport::Cache::FileStore"
25
27
  DefaultCache.new(cache)
26
- when ActiveSupport::Cache::FileStore
28
+ when "ActiveSupport::Cache::MemoryStore"
27
29
  DefaultCache.new(cache)
28
- when ActiveSupport::Cache::MemoryStore
29
- DefaultCache.new(cache)
30
- when ActiveSupport::Cache::RedisCacheStore
30
+ when "ActiveSupport::Cache::RedisCacheStore"
31
31
  RedisCache.new(cache)
32
+ when "ActiveSupport::Cache::MemCacheStore"
33
+ DefaultCache.new(cache)
32
34
  else
33
35
  raise ArgumentError, 'Unsupported cache type'
34
36
  end
@@ -1,3 +1,3 @@
1
1
  module Fastentry
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Alves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-27 00:00:00.000000000 Z
11
+ date: 2019-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails