activerecord-like 2.2 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -10
- data/Appraisals +1 -1
- data/activerecord-like.gemspec +2 -3
- data/gemfiles/{rails_5_0.gemfile → rails_6_0.gemfile} +1 -1
- data/gemfiles/{rails_5_1.gemfile → rails_6_1.gemfile} +1 -1
- data/lib/active_record/like/version.rb +1 -1
- data/lib/active_record/like.rb +7 -1
- data/test/helper.rb +1 -3
- metadata +20 -16
- data/gemfiles/rails_5_2.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 17697882d9797eb85a6b4a1e80d80c49b5fffd8ab8cd8f12f8b2d72214b96dba
|
4
|
+
data.tar.gz: 6270ce1472c08edff4c6bed332cdc291273d240069c47eabfcae5400ebad67a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be7e5510726ad3f76ec93a75720ce28e37e04c13ed7f386cdd43d0faadee816f1cf06073f36a328f0a691ede4e34e6a8780f45fd49a7d6b2b27a1edc828fe8a
|
7
|
+
data.tar.gz: a044ba63ce7215909b9cd807130cf19b5fbe35854afd1291d4e1b05e260adcaa076b1ddd65d52702b72d9ee9a928a353ba774f78e73206a0f16eb3acbf915f7a
|
data/.travis.yml
CHANGED
@@ -3,23 +3,20 @@
|
|
3
3
|
sudo: false
|
4
4
|
language: ruby
|
5
5
|
cache: bundler
|
6
|
+
services:
|
7
|
+
- postgresql
|
8
|
+
- mysql
|
6
9
|
rvm:
|
7
|
-
- 2.
|
8
|
-
-
|
9
|
-
- 2.4.3
|
10
|
-
- 2.5.0
|
10
|
+
- 2.7.5
|
11
|
+
- 3.0.3
|
11
12
|
- ruby-head
|
12
13
|
env:
|
13
14
|
- DB=pg
|
14
15
|
- DB=sqlite3
|
15
16
|
- DB=mysql
|
16
17
|
gemfile:
|
17
|
-
- gemfiles/
|
18
|
-
- gemfiles/
|
19
|
-
- gemfiles/rails_5_2.gemfile
|
20
|
-
before_script:
|
21
|
-
- psql -c 'create database activerecord_like_test' -U postgres
|
22
|
-
- mysql -e 'create database activerecord_like_test'
|
18
|
+
- gemfiles/rails_6_0.gemfile
|
19
|
+
- gemfiles/rails_6_1.gemfile
|
23
20
|
matrix:
|
24
21
|
fast_finish: true
|
25
22
|
allow_failures:
|
data/Appraisals
CHANGED
data/activerecord-like.gemspec
CHANGED
@@ -15,11 +15,10 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.add_dependency "activerecord", ">=
|
18
|
+
gem.add_dependency "activerecord", "~> 6.0", ">= 6.0.0"
|
19
19
|
|
20
20
|
# Required for Travis build to pass
|
21
|
-
|
22
|
-
gem.add_development_dependency "pg", "< 1.0.0"
|
21
|
+
gem.add_development_dependency "pg"
|
23
22
|
gem.add_development_dependency "mysql2"
|
24
23
|
gem.add_development_dependency "sqlite3"
|
25
24
|
|
data/lib/active_record/like.rb
CHANGED
@@ -31,7 +31,13 @@ module ActiveRecord
|
|
31
31
|
# 1. Build a where clause to generate "predicates" & "binds"
|
32
32
|
# 2. Convert "predicates" into the one that matches `node_type` (like/not like)
|
33
33
|
# 3. Re-use binding values to create new where clause
|
34
|
-
equal_where_clause = s.
|
34
|
+
equal_where_clause = if s.respond_to?(:where_clause_factory, true)
|
35
|
+
# ActiveRecord 5.0 to 6.0
|
36
|
+
s.send(:where_clause_factory).build({key => value}, rest)
|
37
|
+
else
|
38
|
+
# ActiveRecord 6.1, maybe higher
|
39
|
+
s.send(:build_where_clause, {key => value}, rest)
|
40
|
+
end
|
35
41
|
equal_where_clause_predicate = equal_where_clause.send(:predicates).first
|
36
42
|
|
37
43
|
new_predicate = if equal_where_clause_predicate.right.is_a?(Array)
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-like
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René van den Berg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6.0'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 6.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '6.0'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 6.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: pg
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
39
|
+
version: '0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
46
|
+
version: '0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: mysql2
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,9 +130,8 @@ files:
|
|
124
130
|
- README.md
|
125
131
|
- Rakefile
|
126
132
|
- activerecord-like.gemspec
|
127
|
-
- gemfiles/
|
128
|
-
- gemfiles/
|
129
|
-
- gemfiles/rails_5_2.gemfile
|
133
|
+
- gemfiles/rails_6_0.gemfile
|
134
|
+
- gemfiles/rails_6_1.gemfile
|
130
135
|
- lib/active_record/like.rb
|
131
136
|
- lib/active_record/like/version.rb
|
132
137
|
- lib/activerecord-like.rb
|
@@ -138,7 +143,7 @@ files:
|
|
138
143
|
homepage: http://github.com/ReneB/activerecord-like
|
139
144
|
licenses: []
|
140
145
|
metadata: {}
|
141
|
-
post_install_message:
|
146
|
+
post_install_message:
|
142
147
|
rdoc_options: []
|
143
148
|
require_paths:
|
144
149
|
- lib
|
@@ -153,9 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
158
|
- !ruby/object:Gem::Version
|
154
159
|
version: '0'
|
155
160
|
requirements: []
|
156
|
-
|
157
|
-
|
158
|
-
signing_key:
|
161
|
+
rubygems_version: 3.2.3
|
162
|
+
signing_key:
|
159
163
|
specification_version: 4
|
160
164
|
summary: 'ActiveRecord::Like provides ActiveRecord::Base with where.like(attribute:
|
161
165
|
string)-style extensions. This functionality was, at one point, included in Rails-master,
|