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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9a5c0c2ab913d52c04984736a54d8a2cd2832ea9
4
- data.tar.gz: 665673067501add2fff21343a6b73d2449ca2604
2
+ SHA256:
3
+ metadata.gz: e147475c1e6b4b462af02ab761e093c7ec9badb99037db674d447e8e6a95ce30
4
+ data.tar.gz: c4788468aafee3e28d1d0b7054ff3764f1bd792c114aeaf6cb7099822b59b8a1
5
5
  SHA512:
6
- metadata.gz: e4cca0a25e3480c37a079bbb41c80e88b6bf06dc73f59fa56640fe6d1dec4ce1c147e6b79cca32db42a3f59f313ec4cac38297acf5d2a371809579bf035be369
7
- data.tar.gz: 208c3fba7b26f6f59b5ea7b7cc82b409c0fc3baeb8aca2da51e017992f027e9087c5fea6dbae303c06ab8d81af7583ccd4db0f8cdd6b7bacd34b67925dc4738d
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.2.8
8
- - 2.3.6
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/rails_5_0.gemfile
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
@@ -1,4 +1,4 @@
1
- ("5.0".."5.2").each do |version|
1
+ ("7.0".."7.0").each do |version|
2
2
  appraise "rails_#{version.tr('.', '_')}" do
3
3
  gem "activerecord", "~> #{version}.0"
4
4
  end
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, and updated to ActiveRecord 5 by @PikachuEXE and 5.2 by @robotdana. 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)).
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
@@ -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", ">= 5.0.0"
18
+ gem.add_dependency "activerecord", "~> 7.0", ">= 7.0.0"
19
19
 
20
20
  # Required for Travis build to pass
21
- # pg 1.x not supported in all AR versions
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 5.0.0"
5
+ gem "activerecord", "~> 7.0.0"
6
6
 
7
7
  gemspec path: "../"
@@ -1,5 +1,5 @@
1
- module ActiveRecord
2
- module Like
3
- VERSION = "2.2"
4
- end
5
- end
1
+ module ActiveRecord
2
+ module Like
3
+ VERSION = "7.0.0"
4
+ end
5
+ end
@@ -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.send(:where_clause_factory).build({key => value}, rest)
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
@@ -92,9 +92,7 @@ else
92
92
  include Test::SQLite3
93
93
  end
94
94
 
95
- unless ENV['TRAVIS'] # if we're running on Travis, no drop/create needed
96
- drop_and_create_database
97
- end
95
+ drop_and_create_database
98
96
 
99
97
  connect_db
100
98
 
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: '2.2'
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: 2018-11-28 00:00:00.000000000 Z
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: 5.0.0
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: 5.0.0
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: 1.0.0
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: 1.0.0
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/rails_5_0.gemfile
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
- rubyforge_project:
157
- rubygems_version: 2.6.14
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,
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.1.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.2.0"
6
-
7
- gemspec path: "../"