cachethod 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmU2Y2VlZDE4ZWZmYjU1MTI3ODJlMjNiMjgwYjViNDQzMWQ0Yjk3Yg==
4
+ NGU5NjU5ZTNhYWNlMGQ2YjJiODAyZGJhZjRkYzQyNzI3YzAzZDQwYQ==
5
5
  data.tar.gz: !binary |-
6
- NWQ4ZDZiOTFhYTFkNWU1YjI5NDA4NTY0NmMyNTAxYTIxZGI0YzdmNg==
6
+ YTg4NmI3MGQ5MTVkZmZjZjIzNTBjMWM3OGZiOGJlNTE0ZWUxOWRkZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDY0MmY3NTdhNTdkMTcxMjhiODkxMWIwZTEyNzI1NGY5NzE2M2E1MjM5ZmY3
10
- OGI0MGQ2ZWE4OGU3MjViOWU1ZTA1MWExYjkyYjY0ZDBmZDFhNjBhYmQ2MWI1
11
- MDVhMDMzNWYwOTQ1ZjUyNjU2YTIxODVhYWU0YTYzOTk3MjZiMDc=
9
+ OTM2MmJmYjZhNjc3ODQxYThhMmQ1ODdkODc0NzI0ZTkxM2I2YjZlZmNiZjRm
10
+ MTE1YTQ0NzMyODE2ZDc5NTI5YjYwOGI0OWEyOTg3NjllMmNlZTdiZTk4YzZm
11
+ OTMzMjc0MWEwZDg2OTVjMTM0NThhNDFjY2IwM2IwNjU5NTUxYjM=
12
12
  data.tar.gz: !binary |-
13
- MDJiOWRhZTJmZmY2ZDViNjM5NzY5NmM4NmZiYThjNzFkZGY1ZDEwYTMwY2Zl
14
- M2E4OWZkMzdlNTdhZmMwZmMzZWI3ZWI0ZWY3ZmExNzkyMDcwNDkwYmMwNzQ1
15
- MzIyNGI0M2RmYzdhZmM5NDY5ZDM4MTY4MzBlODU2NTk3ZTY5ZjM=
13
+ OWJkNzNlOGJjMmFhMjVhYTNkY2I5YTEwZDc5ZTZjYjI0ODAwODFlODc4NmRk
14
+ OTg2MGFjMjAxNGZhMDNmNjQxNDIyMDkxNDNkMjVkNTIyMzVmZjA2NzMyNmM0
15
+ ZTg1Y2RhYjEyMWM3YmIyZGVjNWQ5NmM0NTVlYzYyODkzNDNiM2I=
@@ -31,7 +31,9 @@ class ActiveRecord::Base
31
31
  args = @methods_to_cache.delete(name)
32
32
 
33
33
  define_method "#{name}_cached" do
34
- Rails.cache.fetch("user#{id}.#{name}", *args) do
34
+ cache_key = "cachethod.#{self.class.to_s.underscore}-#{id}.#{name}"
35
+
36
+ Rails.cache.fetch(cache_key, *args) do
35
37
  send("#{name}!")
36
38
  end
37
39
  end
@@ -1,3 +1,3 @@
1
1
  module Cachethod
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cachethod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Klacan
@@ -45,7 +45,6 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - MIT-LICENSE
49
48
  - Rakefile
50
49
  - lib/cachethod.rb
51
50
  - lib/cachethod/active_record_base_ext.rb
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2014 YOURNAME
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.