activerecord-cached_at 5.1.0.1 → 5.2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cached_at/associations/association.rb +1 -1
- data/lib/cached_at/associations/belongs_to_association.rb +2 -2
- data/lib/cached_at/associations/collection_association.rb +2 -2
- data/lib/cached_at/associations/has_many_through_association.rb +3 -3
- data/lib/cached_at/associations/has_one_association.rb +1 -1
- data/lib/cached_at/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 239749f64d6cfea60e5980c0f47fb9bbaa96eca7fa416bed82ba40d0f17fa284
|
4
|
+
data.tar.gz: 161a47ae7ba00f3bb112b24bf26f69f5c9604a0bbf2558f6b34e269a62e524ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4076c01c2720e82212537c1575b6e6d5866b6be0818d6bbbdf0be80ec034613130861fe23e5b5f2e53ad84153ce9b5376df15feb7f734d0e15b466b62763f69
|
7
|
+
data.tar.gz: eec3533e19885cffc9830ce8a6ce9e012e675ffb172aad80bb681554e8320479bc02f3f58438d7a4e75744cefd73d177ff7ac167f6f81c70da8603eeb0fee20a
|
@@ -41,7 +41,7 @@ module CachedAt
|
|
41
41
|
|
42
42
|
source_assoc = owner.association(r.source_reflection_name.to_sym)
|
43
43
|
if source_assoc.loaded?
|
44
|
-
source_assoc.target.
|
44
|
+
source_assoc.target.send(:write_attribute_without_type_cast, cache_column, timestamp)
|
45
45
|
end
|
46
46
|
query = r.klass.where(r.association_primary_key => owner.send(r.foreign_key))
|
47
47
|
query.update_all({ cache_column => timestamp })
|
@@ -45,7 +45,7 @@ module CachedAt
|
|
45
45
|
end
|
46
46
|
|
47
47
|
if loaded? && target
|
48
|
-
target.
|
48
|
+
target.send(:write_attribute_without_type_cast, cache_column, timestamp)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -54,7 +54,7 @@ module CachedAt
|
|
54
54
|
timestamp = Time.now
|
55
55
|
cache_column = "#{options[:inverse_of]}_cached_at"
|
56
56
|
if loaded? && target
|
57
|
-
target.
|
57
|
+
target.send(:write_attribute_without_type_cast, cache_column, timestamp)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -14,7 +14,7 @@ module CachedAt
|
|
14
14
|
query = klass.where({ reflection.foreign_key => ids })
|
15
15
|
|
16
16
|
if loaded?
|
17
|
-
target.each { |r| r.
|
17
|
+
target.each { |r| r.send(:write_attribute_without_type_cast, cache_column, timestamp) }
|
18
18
|
end
|
19
19
|
|
20
20
|
if method != :destroy
|
@@ -40,7 +40,7 @@ module CachedAt
|
|
40
40
|
|
41
41
|
cache_column = "#{reflection.inverse_of.name}_cached_at"
|
42
42
|
|
43
|
-
records.each { |r| r.
|
43
|
+
records.each { |r| r.send(:write_attribute_without_type_cast, cache_column, timestamp) unless r.destroyed? }
|
44
44
|
|
45
45
|
query = klass.where({ klass.primary_key => records.map(&:id) })
|
46
46
|
query.update_all({ cache_column => timestamp })
|
@@ -15,7 +15,7 @@ module CachedAt
|
|
15
15
|
|
16
16
|
query = nil
|
17
17
|
if loaded?
|
18
|
-
target.each { |r| r.
|
18
|
+
target.each { |r| r.send(:write_attribute_without_type_cast, cache_column, timestamp) }
|
19
19
|
query = klass.where(klass.primary_key => target.map(&:id))
|
20
20
|
else
|
21
21
|
ids = [owner.send(using_reflection.association_primary_key), owner.send("#{using_reflection.association_primary_key}_before_last_save")].compact.uniq
|
@@ -35,7 +35,7 @@ module CachedAt
|
|
35
35
|
#TODO: test with new record (fails in mls)
|
36
36
|
if !owner.new_record? && using_reflection.inverse_of && using_reflection.inverse_of.options[:cached_at]
|
37
37
|
cache_column = "#{using_reflection.name}_cached_at"
|
38
|
-
owner.
|
38
|
+
owner.send(:write_attribute_without_type_cast, cache_column, timestamp)
|
39
39
|
owner.update_columns(cache_column => timestamp)
|
40
40
|
end
|
41
41
|
end
|
@@ -50,7 +50,7 @@ module CachedAt
|
|
50
50
|
end
|
51
51
|
|
52
52
|
cache_column = "#{using_reflection.inverse_of.name}_cached_at"
|
53
|
-
records.each { |r| r.
|
53
|
+
records.each { |r| r.send(:write_attribute_without_type_cast, cache_column, timestamp) }
|
54
54
|
query = klass.where(klass.primary_key => records.map(&:id))
|
55
55
|
query.update_all({ cache_column => timestamp })
|
56
56
|
traverse_relationships(klass, using_reflection.options[:cached_at], query, cache_column, timestamp)
|
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.2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.1
|
19
|
+
version: 5.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.1
|
26
|
+
version: 5.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
174
|
+
rubygems_version: 2.7.4
|
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`
|