activerecord-cached_at 2.0.3 → 2.0.4

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
  SHA1:
3
- metadata.gz: 1dd0075311dcc1a39fc67a9523edb1cd62f4c3ce
4
- data.tar.gz: 6d5b46c5bfa3d0140a0c7cfdb008ee939c614351
3
+ metadata.gz: bf203856f29f1e18a87be4892db7fd3396208cbb
4
+ data.tar.gz: 960fc526cd4f5ed35aa6ba3028c8ca367d850ac1
5
5
  SHA512:
6
- metadata.gz: bf419a7f7f193e82c0dff027c662d68c1162a3a034523cc664fc88a6a65c0949ddb0d85cf2455be59862a8f7fff065232b59542eb1fcab092de0e888321008a5
7
- data.tar.gz: 4e6ce7bf2e34be5f3f3dc08d0b048fded4ded82f022f72368e5ad34b3493eed531a5f4050ee88840e08023b0b412e524b0d604445208d07dd390d0c844e3ecdd
6
+ metadata.gz: 8fe18f63b67fd3b7a3e0159f1a1985670c141511e60dcc5b1ee1d05e9fa8ef81a8d8e4d7f0fda6c16bee4a5fef8e84f22d0f1908a1f22c821d65be29da1aa3fe
7
+ data.tar.gz: f6b97535599ac6c02afe3fe63713590065bea24c56e5d6ec7b385e4ad968025c63b75dab3e8ae046a933f972d013ef7dd43911fe9c1868e7b585cbf452e28c11
@@ -86,16 +86,10 @@ module CachedAt
86
86
  else
87
87
  using_reflection.inverse_of.klass._reflections[using_reflection.inverse_of.options[:through].to_s].klass.arel_table
88
88
  end
89
- query = nil
90
- if inverse_reflection.is_a?(ActiveRecord::Reflection::HasAndBelongsToManyReflection)
91
- query = using_reflection.inverse_of.klass.joins(inverse_reflection.inverse_of.options[:through])
92
- query = query.where(arel_table[inverse_reflection.foreign_key].in(ids))
93
- else
94
- query = using_reflection.inverse_of.klass.joins(using_reflection.inverse_of.options[:through])
95
- query = query.where(arel_table[using_reflection.foreign_key].in(ids))
96
- end
97
-
89
+
90
+ query = using_reflection.inverse_of.klass.where(using_reflection.inverse_of.klass.primary_key => owner.id)
98
91
  query.update_all({ cache_column => timestamp })
92
+ puts "#{owner.class.name}.#{cache_column} = #{timestamp}"
99
93
  owner.raw_write_attribute(cache_column, timestamp)
100
94
  traverse_relationships(klass, reflection.options[:cached_at], query, cache_column, timestamp)
101
95
  end
@@ -1,3 +1,3 @@
1
1
  module CachedAt
2
- VERSION = '2.0.3'
2
+ VERSION = '2.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-cached_at
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.beta1
19
+ version: 5.0.0
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.0.0.beta1
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement