activerecord-cached_at 5.1.0 → 5.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cached_at/base.rb +2 -2
- data/lib/cached_at/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a70a7d08a92ea23d008c9ab6f063e44e65244649
|
4
|
+
data.tar.gz: aa57dbad3ff6e72582f1fd65e41695bdf02cf1fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 506bbf8c2591e452b3391e8c1d97a6129c6629918b0c3d24532396adc29d143d8302e6dd08d5915d587d1083b3ec43e6c1e8ee7ab0fca7194751136567a269c1
|
7
|
+
data.tar.gz: d8b452f10dc8f39886f813ce9c9546b84448d02fa2831dfcf990aa2d45b45ec9fb572f547c7eff1e6bcba80e98198ccca8fc7abdebeb904679e6298170363f65
|
data/lib/cached_at/base.rb
CHANGED
@@ -55,9 +55,9 @@ module CachedAt
|
|
55
55
|
cache_column = "#{reflection.name}_cached_at"
|
56
56
|
|
57
57
|
if self.attribute_names.include?(cache_column)
|
58
|
-
if self.
|
58
|
+
if self.changes_to_save.has_key?(reflection.foreign_key) && self.changes_to_save[reflection.foreign_key][1].nil?
|
59
59
|
self.assign_attributes({ cache_column => current_time_from_proper_timezone })
|
60
|
-
elsif (self.
|
60
|
+
elsif (self.changes_to_save[reflection.foreign_key] || self.new_record? || (self.association(reflection.name).loaded? && self.send(reflection.name) && self.send(reflection.name).id.nil?)) && self.send(reflection.name).try(:cached_at)
|
61
61
|
self.assign_attributes({ cache_column => self.send(reflection.name).cached_at })
|
62
62
|
end
|
63
63
|
end
|
data/lib/cached_at/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-cached_at
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.0
|
4
|
+
version: 5.1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.6.
|
174
|
+
rubygems_version: 2.6.13
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Allows ActiveRecord and Rails to use a `cached_at` column for the `cache_key`
|