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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a70a7d08a92ea23d008c9ab6f063e44e65244649
4
- data.tar.gz: aa57dbad3ff6e72582f1fd65e41695bdf02cf1fa
2
+ SHA256:
3
+ metadata.gz: 239749f64d6cfea60e5980c0f47fb9bbaa96eca7fa416bed82ba40d0f17fa284
4
+ data.tar.gz: 161a47ae7ba00f3bb112b24bf26f69f5c9604a0bbf2558f6b34e269a62e524ea
5
5
  SHA512:
6
- metadata.gz: 506bbf8c2591e452b3391e8c1d97a6129c6629918b0c3d24532396adc29d143d8302e6dd08d5915d587d1083b3ec43e6c1e8ee7ab0fca7194751136567a269c1
7
- data.tar.gz: d8b452f10dc8f39886f813ce9c9546b84448d02fa2831dfcf990aa2d45b45ec9fb572f547c7eff1e6bcba80e98198ccca8fc7abdebeb904679e6298170363f65
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.raw_write_attribute(cache_column, timestamp)
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.raw_write_attribute(cache_column, timestamp)
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.raw_write_attribute(cache_column, timestamp)
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.raw_write_attribute(cache_column, timestamp) }
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.raw_write_attribute(cache_column, timestamp) unless r.destroyed? }
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.raw_write_attribute(cache_column, timestamp) }
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.raw_write_attribute(cache_column, timestamp)
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.raw_write_attribute(cache_column, timestamp) }
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)
@@ -24,7 +24,7 @@ module CachedAt
24
24
  end
25
25
 
26
26
  if loaded? && target
27
- target.raw_write_attribute(cache_column, timestamp)
27
+ target.send(:write_attribute_without_type_cast, cache_column, timestamp)
28
28
  end
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module CachedAt
2
- VERSION = '5.1.0.1'
2
+ VERSION = '5.2.1.0'
3
3
  end
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.1
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: 2017-08-29 00:00:00.000000000 Z
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.0
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.0
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.6.13
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`