algoliasearch-rails 1.25.0 → 1.26.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
2
  SHA256:
3
- metadata.gz: 71ddc460401250164dd2422b959edbb444a99bec59ba34fc26facf7b2783b141
4
- data.tar.gz: 4500a5845bafdbc8794d1538056f1c59a7ced17cd49e7c80fa827507d155c532
3
+ metadata.gz: 6e7605f49088d6e5dad323c990b8419c9bd61a19189ee875d59a1b3b9c70c350
4
+ data.tar.gz: 3352a8e76be0c0f1bd25e77a151bec3bb594535effdf4fbe0d6c43c038ade8b4
5
5
  SHA512:
6
- metadata.gz: 7e7512b284a7f61ff4a04f12e7979d632b04a208781b28f2b3690edc75da5b099c83a77205ca0f9ac7298a20e3b7674260b5d2fd1c9471498df95d1ac82be858
7
- data.tar.gz: 51a2e7381403a45f0bdd2f587bdeffe30d375853eeae767a07385ca4ae0bab0c612f1d7b79b143460f5982be9d05bea85c636740b4f2141291155cc241a117bf
6
+ metadata.gz: ab287068f7733e21e9765ee0757c35e1300c5a5a04c227473ad0839935f9eb7d4e1c93a69180605b49f7ebf936bb19029e6c9ecc5e9b431c8b7dcef7c78d7224
7
+ data.tar.gz: b9e3a0aa8dfbbd213fb02443933407ec74b3a1b2bc0013e90e83171fd06b42d76938bd450fb4fe90e5e39d8d78b6c29cbc70eae2bfc1c5736cf19d09d8a6042e
data/CHANGELOG.MD CHANGED
@@ -1,6 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
- ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/1.25.0...master)
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/1.26.0...master)
4
+
5
+ ## [1.26.0](https://github.com/algolia/algoliasearch-rails/compare/1.25.0...1.26.0) (2021-09-03)
6
+
7
+ ### Added
8
+
9
+ - Implement virtual replicas ([#409](https://github.com/algolia/algoliasearch-rails/pull/409))
4
10
 
5
11
  ## [1.25.0](https://github.com/algolia/algoliasearch-rails/compare/1.24.1...1.25.0) (2020-11-24)
6
12
 
data/Gemfile CHANGED
@@ -8,8 +8,8 @@ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
8
8
  end
9
9
 
10
10
  group :test do
11
- rails_version = ENV["RAILS_VERSION"] ? "~> #{ENV["RAILS_VERSION"]}" : '>= 3.2.0'
12
- gem 'rails', rails_version
11
+ rails_version = ENV["RAILS_VERSION"] || '5.2'
12
+ gem 'rails', "~> #{rails_version}"
13
13
  gem 'active_model_serializers'
14
14
  if defined?(RUBY_VERSION) && RUBY_VERSION == "1.8.7"
15
15
  gem 'i18n', '< 0.7'
@@ -34,8 +34,12 @@ group :test do
34
34
  Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1')
35
35
  gem 'net-http-persistent', '< 3.0'
36
36
  end
37
+ if Gem::Version.new(rails_version) >= Gem::Version.new('6.0')
38
+ gem 'sqlite3', '~> 1.4.0', :platform => [:rbx, :ruby]
39
+ else
40
+ gem 'sqlite3', '< 1.4.0', :platform => [:rbx, :ruby]
41
+ end
37
42
  gem 'rspec', '>= 2.5.0', '< 3.0'
38
- gem 'sqlite3', '< 1.4.0', :platform => [:rbx, :ruby]
39
43
  gem 'jdbc-sqlite3', :platform => :jruby
40
44
  gem 'activerecord-jdbc-adapter', :platform => :jruby
41
45
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
data/Gemfile.lock CHANGED
@@ -1,153 +1,152 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actioncable (5.2.4.4)
5
- actionpack (= 5.2.4.4)
4
+ actioncable (5.2.2)
5
+ actionpack (= 5.2.2)
6
6
  nio4r (~> 2.0)
7
7
  websocket-driver (>= 0.6.1)
8
- actionmailer (5.2.4.4)
9
- actionpack (= 5.2.4.4)
10
- actionview (= 5.2.4.4)
11
- activejob (= 5.2.4.4)
8
+ actionmailer (5.2.2)
9
+ actionpack (= 5.2.2)
10
+ actionview (= 5.2.2)
11
+ activejob (= 5.2.2)
12
12
  mail (~> 2.5, >= 2.5.4)
13
13
  rails-dom-testing (~> 2.0)
14
- actionpack (5.2.4.4)
15
- actionview (= 5.2.4.4)
16
- activesupport (= 5.2.4.4)
17
- rack (~> 2.0, >= 2.0.8)
14
+ actionpack (5.2.2)
15
+ actionview (= 5.2.2)
16
+ activesupport (= 5.2.2)
17
+ rack (~> 2.0)
18
18
  rack-test (>= 0.6.3)
19
19
  rails-dom-testing (~> 2.0)
20
20
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
21
- actionview (5.2.4.4)
22
- activesupport (= 5.2.4.4)
21
+ actionview (5.2.2)
22
+ activesupport (= 5.2.2)
23
23
  builder (~> 3.1)
24
24
  erubi (~> 1.4)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
27
- active_model_serializers (0.10.10)
28
- actionpack (>= 4.1, < 6.1)
29
- activemodel (>= 4.1, < 6.1)
27
+ active_model_serializers (0.10.8)
28
+ actionpack (>= 4.1, < 6)
29
+ activemodel (>= 4.1, < 6)
30
30
  case_transform (>= 0.2)
31
31
  jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
32
- activejob (5.2.4.4)
33
- activesupport (= 5.2.4.4)
32
+ activejob (5.2.2)
33
+ activesupport (= 5.2.2)
34
34
  globalid (>= 0.3.6)
35
- activemodel (5.2.4.4)
36
- activesupport (= 5.2.4.4)
37
- activerecord (5.2.4.4)
38
- activemodel (= 5.2.4.4)
39
- activesupport (= 5.2.4.4)
35
+ activemodel (5.2.2)
36
+ activesupport (= 5.2.2)
37
+ activerecord (5.2.2)
38
+ activemodel (= 5.2.2)
39
+ activesupport (= 5.2.2)
40
40
  arel (>= 9.0)
41
- activestorage (5.2.4.4)
42
- actionpack (= 5.2.4.4)
43
- activerecord (= 5.2.4.4)
41
+ activestorage (5.2.2)
42
+ actionpack (= 5.2.2)
43
+ activerecord (= 5.2.2)
44
44
  marcel (~> 0.3.1)
45
- activesupport (5.2.4.4)
45
+ activesupport (5.2.2)
46
46
  concurrent-ruby (~> 1.0, >= 1.0.2)
47
47
  i18n (>= 0.7, < 2)
48
48
  minitest (~> 5.1)
49
49
  tzinfo (~> 1.1)
50
- addressable (2.7.0)
51
- public_suffix (>= 2.0.2, < 5.0)
52
- algoliasearch (1.27.5)
50
+ addressable (2.4.0)
51
+ algoliasearch (1.27.4)
53
52
  httpclient (~> 2.8, >= 2.8.3)
54
53
  json (>= 1.5.1)
55
54
  arel (9.0.0)
56
- builder (3.2.4)
55
+ backports (3.11.4)
56
+ builder (3.2.3)
57
57
  case_transform (0.2)
58
58
  activesupport
59
- concurrent-ruby (1.1.7)
60
- crass (1.0.6)
61
- diff-lcs (1.4.4)
62
- erubi (1.9.0)
63
- faraday (1.1.0)
59
+ concurrent-ruby (1.1.4)
60
+ crass (1.0.4)
61
+ diff-lcs (1.3)
62
+ erubi (1.8.0)
63
+ ethon (0.11.0)
64
+ ffi (>= 1.3.0)
65
+ faraday (0.15.4)
64
66
  multipart-post (>= 1.2, < 3)
65
- ruby2_keywords
66
- faraday_middleware (1.0.0)
67
- faraday (~> 1.0)
68
- gh (0.18.0)
69
- activesupport (~> 5.0)
70
- addressable (~> 2.4)
71
- faraday (~> 1.0)
72
- faraday_middleware (~> 1.0)
67
+ faraday_middleware (0.12.2)
68
+ faraday (>= 0.7.4, < 1.0)
69
+ ffi (1.9.25)
70
+ gh (0.15.1)
71
+ addressable (~> 2.4.0)
72
+ backports
73
+ faraday (~> 0.8)
73
74
  multi_json (~> 1.0)
74
75
  net-http-persistent (~> 2.9)
75
76
  net-http-pipeline
76
- globalid (0.4.2)
77
+ globalid (0.4.1)
77
78
  activesupport (>= 4.2.0)
78
- highline (2.0.3)
79
+ highline (1.7.10)
79
80
  httpclient (2.8.3)
80
- i18n (1.8.5)
81
+ i18n (1.4.0)
81
82
  concurrent-ruby (~> 1.0)
82
83
  json (1.8.6)
83
- json_pure (2.3.1)
84
- jsonapi-renderer (0.2.2)
85
- kaminari (1.2.1)
84
+ jsonapi-renderer (0.2.0)
85
+ kaminari (1.1.1)
86
86
  activesupport (>= 4.1.0)
87
- kaminari-actionview (= 1.2.1)
88
- kaminari-activerecord (= 1.2.1)
89
- kaminari-core (= 1.2.1)
90
- kaminari-actionview (1.2.1)
87
+ kaminari-actionview (= 1.1.1)
88
+ kaminari-activerecord (= 1.1.1)
89
+ kaminari-core (= 1.1.1)
90
+ kaminari-actionview (1.1.1)
91
91
  actionview
92
- kaminari-core (= 1.2.1)
93
- kaminari-activerecord (1.2.1)
92
+ kaminari-core (= 1.1.1)
93
+ kaminari-activerecord (1.1.1)
94
94
  activerecord
95
- kaminari-core (= 1.2.1)
96
- kaminari-core (1.2.1)
95
+ kaminari-core (= 1.1.1)
96
+ kaminari-core (1.1.1)
97
97
  launchy (2.4.3)
98
98
  addressable (~> 2.3)
99
- loofah (2.7.0)
99
+ loofah (2.2.3)
100
100
  crass (~> 1.0.2)
101
101
  nokogiri (>= 1.5.9)
102
102
  mail (2.7.1)
103
103
  mini_mime (>= 0.1.1)
104
104
  marcel (0.3.3)
105
105
  mimemagic (~> 0.3.2)
106
- method_source (1.0.0)
107
- mimemagic (0.3.5)
108
- mini_mime (1.0.2)
106
+ method_source (0.9.2)
107
+ mimemagic (0.3.3)
108
+ mini_mime (1.0.1)
109
109
  mini_portile2 (2.4.0)
110
- minitest (5.14.2)
111
- multi_json (1.15.0)
112
- multipart-post (2.1.1)
110
+ minitest (5.11.3)
111
+ multi_json (1.13.1)
112
+ multipart-post (2.0.0)
113
113
  net-http-persistent (2.9.4)
114
114
  net-http-pipeline (1.0.1)
115
- nio4r (2.5.4)
116
- nokogiri (1.10.10)
115
+ nio4r (2.3.1)
116
+ nokogiri (1.9.1)
117
117
  mini_portile2 (~> 2.4.0)
118
- public_suffix (4.0.6)
119
118
  pusher-client (0.6.2)
120
119
  json
121
120
  websocket (~> 1.0)
122
- rack (2.2.3)
121
+ rack (2.0.6)
123
122
  rack-test (1.1.0)
124
123
  rack (>= 1.0, < 3)
125
- rails (5.2.4.4)
126
- actioncable (= 5.2.4.4)
127
- actionmailer (= 5.2.4.4)
128
- actionpack (= 5.2.4.4)
129
- actionview (= 5.2.4.4)
130
- activejob (= 5.2.4.4)
131
- activemodel (= 5.2.4.4)
132
- activerecord (= 5.2.4.4)
133
- activestorage (= 5.2.4.4)
134
- activesupport (= 5.2.4.4)
124
+ rails (5.2.2)
125
+ actioncable (= 5.2.2)
126
+ actionmailer (= 5.2.2)
127
+ actionpack (= 5.2.2)
128
+ actionview (= 5.2.2)
129
+ activejob (= 5.2.2)
130
+ activemodel (= 5.2.2)
131
+ activerecord (= 5.2.2)
132
+ activestorage (= 5.2.2)
133
+ activesupport (= 5.2.2)
135
134
  bundler (>= 1.3.0)
136
- railties (= 5.2.4.4)
135
+ railties (= 5.2.2)
137
136
  sprockets-rails (>= 2.0.0)
138
137
  rails-dom-testing (2.0.3)
139
138
  activesupport (>= 4.2.0)
140
139
  nokogiri (>= 1.6)
141
- rails-html-sanitizer (1.3.0)
142
- loofah (~> 2.3)
143
- railties (5.2.4.4)
144
- actionpack (= 5.2.4.4)
145
- activesupport (= 5.2.4.4)
140
+ rails-html-sanitizer (1.0.4)
141
+ loofah (~> 2.2, >= 2.2.2)
142
+ railties (5.2.2)
143
+ actionpack (= 5.2.2)
144
+ activesupport (= 5.2.2)
146
145
  method_source
147
146
  rake (>= 0.8.7)
148
147
  thor (>= 0.19.0, < 2.0)
149
148
  rake (10.1.1)
150
- rdoc (6.2.1)
149
+ rdoc (6.1.1)
151
150
  redgreen (1.2.2)
152
151
  rspec (2.99.0)
153
152
  rspec-core (~> 2.99.0)
@@ -157,33 +156,35 @@ GEM
157
156
  rspec-expectations (2.99.2)
158
157
  diff-lcs (>= 1.1.3, < 2.0)
159
158
  rspec-mocks (2.99.4)
160
- ruby2_keywords (0.0.2)
161
- sequel (5.38.0)
162
- sprockets (4.0.2)
159
+ sequel (5.16.0)
160
+ sprockets (3.7.2)
163
161
  concurrent-ruby (~> 1.0)
164
162
  rack (> 1, < 3)
165
- sprockets-rails (3.2.2)
163
+ sprockets-rails (3.2.1)
166
164
  actionpack (>= 4.0)
167
165
  activesupport (>= 4.0)
168
166
  sprockets (>= 3.0.0)
169
167
  sqlite3 (1.3.13)
170
- thor (1.0.1)
168
+ thor (0.20.3)
171
169
  thread_safe (0.3.6)
172
- travis (1.10.0)
173
- faraday (~> 1.0)
174
- faraday_middleware (~> 1.0)
170
+ travis (1.8.9)
171
+ backports
172
+ faraday (~> 0.9)
173
+ faraday_middleware (~> 0.9, >= 0.9.1)
175
174
  gh (~> 0.13)
176
- highline (~> 2.0)
177
- json_pure (~> 2.3)
178
- launchy (~> 2.1, < 2.5.0)
175
+ highline (~> 1.6)
176
+ launchy (~> 2.1)
179
177
  pusher-client (~> 0.4)
180
- tzinfo (1.2.7)
178
+ typhoeus (~> 0.6, >= 0.6.8)
179
+ typhoeus (0.8.0)
180
+ ethon (>= 0.8.0)
181
+ tzinfo (1.2.5)
181
182
  thread_safe (~> 0.1)
182
183
  websocket (1.2.8)
183
- websocket-driver (0.7.3)
184
+ websocket-driver (0.7.0)
184
185
  websocket-extensions (>= 0.1.0)
185
- websocket-extensions (0.1.5)
186
- will_paginate (3.3.0)
186
+ websocket-extensions (0.1.3)
187
+ will_paginate (3.1.6)
187
188
 
188
189
  PLATFORMS
189
190
  ruby
@@ -196,7 +197,7 @@ DEPENDENCIES
196
197
  jdbc-sqlite3
197
198
  json (~> 1.8, >= 1.8.6)
198
199
  kaminari
199
- rails (>= 3.2.0)
200
+ rails (~> 5.2)
200
201
  rake (~> 10.1.0)
201
202
  rdoc
202
203
  redgreen
@@ -207,4 +208,4 @@ DEPENDENCIES
207
208
  will_paginate (>= 2.3.15)
208
209
 
209
210
  BUNDLED WITH
210
- 2.1.4
211
+ 1.17.2
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your Rails project</h4>
7
7
 
8
8
  <p align="center">
9
- <a href="https://travis-ci.org/algolia/algoliasearch-rails"><img src="https://img.shields.io/travis/algolia/algoliasearch-rails/master.svg" alt="Build Status"></img></a>
9
+ <a href="https://circleci.com/gh/algolia/algoliasearch-rails"><img src="https://circleci.com/gh/algolia/algoliasearch-rails.svg?style=shield" alt="CircleCI" /></a>
10
10
  <a href="http://badge.fury.io/rb/algoliasearch-rails"><img src="https://badge.fury.io/rb/algoliasearch-rails.svg" alt="Gem Version"></img></a>
11
11
  <a href="https://codeclimate.com/github/algolia/algoliasearch-rails"><img src="https://codeclimate.com/github/algolia/algoliasearch-rails.svg" alt="Code Climate"></img></a>
12
12
  <img src="https://img.shields.io/badge/ActiveRecord-yes-blue.svg?style=flat-square" alt="ActiveRecord"></img>
@@ -9,7 +9,7 @@ module AlgoliaSearch
9
9
  class Kaminari < ::Kaminari::PaginatableArray
10
10
 
11
11
  def initialize(array, options)
12
- super(array, options)
12
+ super(array, **options)
13
13
  end
14
14
 
15
15
  def limit(num)
@@ -2,7 +2,7 @@ module AlgoliaSearch
2
2
  module Utilities
3
3
  class << self
4
4
  def get_model_classes
5
- if defined?(Rails.autoloaders) && Rails.autoloaders.zeitwerk_enabled?
5
+ if Rails.application && defined?(Rails.autoloaders) && Rails.autoloaders.zeitwerk_enabled?
6
6
  Zeitwerk::Loader.eager_load_all
7
7
  elsif Rails.application
8
8
  Rails.application.eager_load!
@@ -1,3 +1,3 @@
1
1
  module AlgoliaSearch
2
- VERSION = '1.25.0'
2
+ VERSION = '1.26.0'
3
3
  end
@@ -252,12 +252,14 @@ module AlgoliaSearch
252
252
  settings[:slaves] = additional_indexes.select { |opts, s| opts[:slave] }.map do |opts, s|
253
253
  name = opts[:index_name]
254
254
  name = "#{name}_#{Rails.env.to_s}" if opts[:per_environment]
255
+ name = "virtual(#{name})" if opts[:virtual]
255
256
  name
256
257
  end
257
258
  settings.delete(:slaves) if settings[:slaves].empty?
258
259
  settings[:replicas] = additional_indexes.select { |opts, s| opts[:replica] }.map do |opts, s|
259
260
  name = opts[:index_name]
260
261
  name = "#{name}_#{Rails.env.to_s}" if opts[:per_environment]
262
+ name = "virtual(#{name})" if opts[:virtual]
261
263
  name
262
264
  end
263
265
  settings.delete(:replicas) if settings[:replicas].empty?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.0
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-24 00:00:00.000000000 Z
11
+ date: 2021-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json