activerecord-like 2.2 → 7.0.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 +6 -10
- data/Appraisals +1 -1
- data/README.md +1 -1
- data/activerecord-like.gemspec +2 -3
- data/gemfiles/{rails_5_0.gemfile → rails_7_0.gemfile} +1 -1
- data/lib/active_record/like/version.rb +5 -5
- data/lib/active_record/like.rb +7 -1
- data/test/helper.rb +1 -3
- metadata +19 -16
- data/gemfiles/rails_5_1.gemfile +0 -7
- 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: e147475c1e6b4b462af02ab761e093c7ec9badb99037db674d447e8e6a95ce30
|
4
|
+
data.tar.gz: c4788468aafee3e28d1d0b7054ff3764f1bd792c114aeaf6cb7099822b59b8a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a8bd5af414f203038d61ff3363a99d5179843ba974f307e2dc3154a39f2a7a8ddc67711e4851f60aff14b4c4bf013e8ad6ed58880b9ba2f454daf8d8f30264
|
7
|
+
data.tar.gz: 06adf3e3a2b855bff6d70a2b5d82902f45b435a42bf031abe0498664c55dc05f4e232d53abb32d219ba8b5b1a216385756891cff229748c886734b13f8073c02
|
data/.travis.yml
CHANGED
@@ -3,23 +3,19 @@
|
|
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/rails_5_1.gemfile
|
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_7_0.gemfile
|
23
19
|
matrix:
|
24
20
|
fast_finish: true
|
25
21
|
allow_failures:
|
data/Appraisals
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
An Active Record Plugin that allows chaining a more DSL-style 'like' or 'not-like' query to an ActiveRecord::Base#where. Requires Rails 5 or higher.
|
11
11
|
|
12
|
-
This plugin has been salvaged from the stellar work done by @amatsuda and @claudiob,
|
12
|
+
This plugin has been salvaged from the stellar work done by @amatsuda and @claudiob, updated to ActiveRecord 5 by @PikachuEXE and 5.2 by @robotdana and then to ActiveRecord 6.1 by @nrw505. Most of the code was previously in Active Record master, but was subsequently removed due to, amongst other, scope creep (see discussion [here](https://github.com/rails/rails/commit/8d02afeaee8993bd0fde69687fdd9bf30921e805)).
|
13
13
|
Array parameter handling was added by @rzane - thanks!
|
14
14
|
|
15
15
|
## Installation
|
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", "~> 7.0", ">= 7.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
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
module Like
|
3
|
-
VERSION = "
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module ActiveRecord
|
2
|
+
module Like
|
3
|
+
VERSION = "7.0.0"
|
4
|
+
end
|
5
|
+
end
|
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: 7.0.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-10-17 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: '7.0'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 7.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: '7.0'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 7.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,7 @@ files:
|
|
124
130
|
- README.md
|
125
131
|
- Rakefile
|
126
132
|
- activerecord-like.gemspec
|
127
|
-
- gemfiles/
|
128
|
-
- gemfiles/rails_5_1.gemfile
|
129
|
-
- gemfiles/rails_5_2.gemfile
|
133
|
+
- gemfiles/rails_7_0.gemfile
|
130
134
|
- lib/active_record/like.rb
|
131
135
|
- lib/active_record/like/version.rb
|
132
136
|
- lib/activerecord-like.rb
|
@@ -138,7 +142,7 @@ files:
|
|
138
142
|
homepage: http://github.com/ReneB/activerecord-like
|
139
143
|
licenses: []
|
140
144
|
metadata: {}
|
141
|
-
post_install_message:
|
145
|
+
post_install_message:
|
142
146
|
rdoc_options: []
|
143
147
|
require_paths:
|
144
148
|
- lib
|
@@ -153,9 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
157
|
- !ruby/object:Gem::Version
|
154
158
|
version: '0'
|
155
159
|
requirements: []
|
156
|
-
|
157
|
-
|
158
|
-
signing_key:
|
160
|
+
rubygems_version: 3.2.3
|
161
|
+
signing_key:
|
159
162
|
specification_version: 4
|
160
163
|
summary: 'ActiveRecord::Like provides ActiveRecord::Base with where.like(attribute:
|
161
164
|
string)-style extensions. This functionality was, at one point, included in Rails-master,
|
data/gemfiles/rails_5_1.gemfile
DELETED