counter_cache_update 0.0.0 → 0.0.1

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: c9fdec978994bcd0e8a2fc20b35c99f3e0ea7c4b
4
- data.tar.gz: ed8efce81568e503dfa5bbee9afb49e693c5eb48
3
+ metadata.gz: 612e3322b4f6660aee4c90461cb98dc2a3b7d9d5
4
+ data.tar.gz: 83f8c0cec5da605ff621ce17b7a5220660d1d4a5
5
5
  SHA512:
6
- metadata.gz: 7d0a2ee8c5a1015d1add9559a0adddaa5064be6f0d66a0043239ea2011822c21ff9db9287dc511c9b6183a8761f85d4b99e66a3d6b87d3ee59bc4c7dc6883def
7
- data.tar.gz: e792bccd9c7cd79cee134cecdb919d1ac3f90cafe7b88e3345b125fab3225b4f3134e1f49ed47185c545d4271c2fd1f5a8ec5ec07e205a4c220c3fd03d0ec56c
6
+ metadata.gz: fba1046c4769cf685c3c57d9420cfd28f5ebea989900760304eb859ee4e8bc094f31b0697329ccc1a54acff6f865248eb520e81c68790aa240ddb31229283209
7
+ data.tar.gz: e55553d1d386bc0ef45091d6fb23815950f0e92475001c8e67d8445ff24742d37a61f66698a27ec1461382dcf1889dfdd3623883edf53d0cde6125067a7589ec
@@ -24,15 +24,15 @@ private
24
24
  end
25
25
 
26
26
  def count_sql
27
- "SELECT COUNT(*) FROM #{reflection_table_name} WHERE #{reflection_table_name}.#{reflection_primary_key} = #{table_name}.#{primary_key}"
27
+ "SELECT COUNT(*) FROM #{reflection_table_name} WHERE #{reflection_table_name}.#{relation_foreign_key} = #{table_name}.#{primary_key}"
28
28
  end
29
29
 
30
30
  def primary_key
31
31
  model_class.primary_key
32
32
  end
33
33
 
34
- def reflection_primary_key
35
- reflection.active_record.primary_key
34
+ def relation_foreign_key
35
+ reflection.foreign_key
36
36
  end
37
37
 
38
38
  def reflection_table_name
@@ -1,3 +1,3 @@
1
1
  module CounterCacheUpdate
2
- VERSION = "0.0.0".freeze
2
+ VERSION = "0.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counter_cache_update
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2018-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails