activerecord_where_assoc 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: b4af9bc1903c723220337ad86c96b760972d233e978f4f13c4a48bff4bcaf053
4
- data.tar.gz: c3ecf63db878f798fbc3bc8d670b64d6f762fedbc7bc66b736e95c7eb8702341
3
+ metadata.gz: c33267f5201fd0465cceec484dd0a2c91b3511b47289f500311e0d3a3946b28f
4
+ data.tar.gz: 0b1ef81c3b3106a0226ed72494523ce3a2ebb005f4b1401d6cca3917a78bfa26
5
5
  SHA512:
6
- metadata.gz: 144fe868a09d055a6523b99e6548aef6113d17d6e69179da71c9ebaf8fd257197a7b2a39678d8385317f227a72afcc63dd17fb34190e6694c40f3380a00367ff
7
- data.tar.gz: 6ff02bae5d25b71be3fdc81b095499cc9a0575cea10eb25372e0d85e541195ba186f7d43cbef5ac342ed81d95b96919e357687ef81f2d100cbdcc9462e03cf32
6
+ metadata.gz: 156df4226e93a9d5a8e900a71b518d42ff984a47a8917d7d807429d3b473a5f8db7d392496c8f4dfda7f0746689b9127547d238b2f875846235c9075e4789f7b
7
+ data.tar.gz: fbea2c6d875f87c5b04d740fb6878d1f9ece9e11ba0053d38bbe6c8cb6311b194be770ebd402bc59a2baad10c3ecac8ee9f5e2bad8f6147ea152d8e8c2a96518
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # ActiveRecord Where Assoc
2
2
 
3
- [![Build Status](https://travis-ci.org/MaxLap/activerecord_where_assoc.svg?branch=master)](https://travis-ci.org/MaxLap/activerecord_where_assoc)
4
- [![Coverage Status](https://coveralls.io/repos/github/MaxLap/activerecord_where_assoc/badge.svg)](https://coveralls.io/github/MaxLap/activerecord_where_assoc)
3
+ ![Test supported versions](https://github.com/MaxLap/activerecord_where_assoc/workflows/Test%20supported%20versions/badge.svg)
5
4
  [![Code Climate](https://codeclimate.com/github/MaxLap/activerecord_where_assoc/badges/gpa.svg)](https://codeclimate.com/github/MaxLap/activerecord_where_assoc)
6
- [![Issue Count](https://codeclimate.com/github/MaxLap/activerecord_where_assoc/badges/issue_count.svg)](https://codeclimate.com/github/MaxLap/activerecord_where_assoc)
7
5
 
8
6
  This gem makes it easy to do conditions based on the associations of your records in ActiveRecord (Rails). (Using SQL's `EXISTS` operator)
9
7
 
@@ -39,7 +37,7 @@ These methods have many advantages over the alternative ways of achieving the si
39
37
 
40
38
  ## Installation
41
39
 
42
- Rails 4.1 to 6.0 are supported with Ruby 2.1 to 2.7.
40
+ Rails 4.1 to 6.1 are supported with Ruby 2.1 to 2.7.
43
41
  Tested against SQLite3, PostgreSQL and MySQL.
44
42
  The gem only depends on the `activerecord` gem.
45
43
 
@@ -2,7 +2,17 @@
2
2
 
3
3
  module ActiveRecordWhereAssoc
4
4
  module ActiveRecordCompat
5
- if ActiveRecord.gem_version >= Gem::Version.new("5.1")
5
+ if ActiveRecord.gem_version >= Gem::Version.new("6.1.0.rc1")
6
+ JoinKeys = Struct.new(:key, :foreign_key)
7
+ def self.join_keys(reflection, poly_belongs_to_klass)
8
+ if poly_belongs_to_klass
9
+ JoinKeys.new(reflection.join_primary_key(poly_belongs_to_klass), reflection.join_foreign_key)
10
+ else
11
+ JoinKeys.new(reflection.join_primary_key, reflection.join_foreign_key)
12
+ end
13
+ end
14
+
15
+ elsif ActiveRecord.gem_version >= Gem::Version.new("5.1")
6
16
  def self.join_keys(reflection, poly_belongs_to_klass)
7
17
  if poly_belongs_to_klass
8
18
  reflection.get_join_keys(poly_belongs_to_klass)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordWhereAssoc
4
- VERSION = "1.1.1".freeze
4
+ VERSION = "1.1.2".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_where_assoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Handfield Lapointe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-13 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
- - !ruby/object:Gem::Dependency
84
- name: coveralls
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: deep-cover
99
85
  requirement: !ruby/object:Gem::Requirement