algoliasearch-rails 1.23.0 → 1.25.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: 6aa4976dffc097e623adfa3426845bceb29262940094082668defb70ecda498c
4
- data.tar.gz: 72a7af5ba91d37dce26523a87562a2d571843d8322e19d7183153d677463d286
3
+ metadata.gz: 71ddc460401250164dd2422b959edbb444a99bec59ba34fc26facf7b2783b141
4
+ data.tar.gz: 4500a5845bafdbc8794d1538056f1c59a7ced17cd49e7c80fa827507d155c532
5
5
  SHA512:
6
- metadata.gz: c2b612ef3d142bd24aa7342f636fcb3659794611f51f413ac3e3586aca35954f5c3ae5f95481baa8fd091468caa9e2b5197bbf0d3529b1628a99fc1945519a0e
7
- data.tar.gz: ec3ccc8b3589c89ddd3fada065304f087e47197ac876902969db526824ff38ea7335c3b37e4d6b32072c9251b5cf70d131559c2937c23ef414debf838c9161af
6
+ metadata.gz: 7e7512b284a7f61ff4a04f12e7979d632b04a208781b28f2b3690edc75da5b099c83a77205ca0f9ac7298a20e3b7674260b5d2fd1c9471498df95d1ac82be858
7
+ data.tar.gz: 51a2e7381403a45f0bdd2f587bdeffe30d375853eeae767a07385ca4ae0bab0c612f1d7b79b143460f5982be9d05bea85c636740b4f2141291155cc241a117bf
@@ -8,6 +8,7 @@ matrix:
8
8
  include:
9
9
  - rvm: 1.8.7
10
10
  env: RAILS_VERSION=3.2.0 SEQUEL_VERSION=4.0
11
+ dist: trusty
11
12
  - rvm: 1.9.3
12
13
  env: RAILS_VERSION=3.2.0
13
14
  - rvm: 1.9.3
@@ -32,8 +33,16 @@ matrix:
32
33
  env: RAILS_VERSION=5.1 SEQUEL_VERSION=5.0
33
34
  - rvm: 2.5.3
34
35
  env: RAILS_VERSION=5.1 SEQUEL_VERSION=5.0
36
+ - rvm: 2.5.3
37
+ env: RAILS_VERSION=6.0 SEQUEL_VERSION=5.0
38
+ - rvm: 2.6.0
39
+ env: RAILS_VERSION=5.2 SEQUEL_VERSION=5.0
35
40
  - rvm: 2.6.0
41
+ env: RAILS_VERSION=6.0 SEQUEL_VERSION=5.0
42
+ - rvm: 2.7.0
36
43
  env: RAILS_VERSION=5.2 SEQUEL_VERSION=5.0
44
+ - rvm: 2.7.0
45
+ env: RAILS_VERSION=6.0 SEQUEL_VERSION=5.0
37
46
 
38
47
  before_install:
39
48
  - wget http://api-key-dealer.herokuapp.com/clients/algolia-keys && chmod +x algolia-keys
@@ -1,5 +1,35 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/1.25.0...master)
4
+
5
+ ## [1.25.0](https://github.com/algolia/algoliasearch-rails/compare/1.24.1...1.25.0) (2020-11-24)
6
+
7
+ ### Added
8
+ - Pass array argument to geoloc ([#372](https://github.com/algolia/algoliasearch-rails/pull/372))
9
+ - Containerize the repo ([#391](https://github.com/algolia/algoliasearch-rails/pull/391))
10
+
11
+ ### Fixed
12
+ - Use Zeitwerk for loading models in Rails 6 ([#364](https://github.com/algolia/algoliasearch-rails/pull/364))
13
+
14
+ ## [1.24.1](https://github.com/algolia/algoliasearch-rails/releases/tag/1.24.1) (2020-07-15)
15
+
16
+ **Fixed**
17
+
18
+ * Fixes ruby warning 'Proc.new is deprecated'
19
+
20
+ ## [1.24.0](https://github.com/algolia/algoliasearch-rails/releases/tag/1.24.0) (2020-02-21)
21
+
22
+ **Added**
23
+
24
+ * Adds indexLanguages in index settings
25
+
26
+ ## [1.23.2](https://github.com/algolia/algoliasearch-rails/releases/tag/1.23.2) (2019-06-26)
27
+
28
+ **Fixed**
29
+
30
+ * Use `copy_index` when initiating a temporary index to preserve settings, synonyms, and rules.
31
+
32
+
3
33
  ## [1.23.0](https://github.com/algolia/algoliasearch-rails/releases/tag/1.23.0) (2019-06-25)
4
34
 
5
35
  **Added**
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'json', '~> 1.8', '>= 1.8.6'
4
- gem 'algoliasearch', '>= 1.23.0', '< 2.0.0'
4
+ gem 'algoliasearch', '>= 1.26.0', '< 2.0.0'
5
5
 
6
6
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
7
7
  gem 'rubysl', '~> 2.0', :platform => :rbx
@@ -1,152 +1,153 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actioncable (5.2.3)
5
- actionpack (= 5.2.3)
4
+ actioncable (5.2.4.4)
5
+ actionpack (= 5.2.4.4)
6
6
  nio4r (~> 2.0)
7
7
  websocket-driver (>= 0.6.1)
8
- actionmailer (5.2.3)
9
- actionpack (= 5.2.3)
10
- actionview (= 5.2.3)
11
- activejob (= 5.2.3)
8
+ actionmailer (5.2.4.4)
9
+ actionpack (= 5.2.4.4)
10
+ actionview (= 5.2.4.4)
11
+ activejob (= 5.2.4.4)
12
12
  mail (~> 2.5, >= 2.5.4)
13
13
  rails-dom-testing (~> 2.0)
14
- actionpack (5.2.3)
15
- actionview (= 5.2.3)
16
- activesupport (= 5.2.3)
17
- rack (~> 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)
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.3)
22
- activesupport (= 5.2.3)
21
+ actionview (5.2.4.4)
22
+ activesupport (= 5.2.4.4)
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.9)
28
- actionpack (>= 4.1, < 6)
29
- activemodel (>= 4.1, < 6)
27
+ active_model_serializers (0.10.10)
28
+ actionpack (>= 4.1, < 6.1)
29
+ activemodel (>= 4.1, < 6.1)
30
30
  case_transform (>= 0.2)
31
31
  jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
32
- activejob (5.2.3)
33
- activesupport (= 5.2.3)
32
+ activejob (5.2.4.4)
33
+ activesupport (= 5.2.4.4)
34
34
  globalid (>= 0.3.6)
35
- activemodel (5.2.3)
36
- activesupport (= 5.2.3)
37
- activerecord (5.2.3)
38
- activemodel (= 5.2.3)
39
- activesupport (= 5.2.3)
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)
40
40
  arel (>= 9.0)
41
- activestorage (5.2.3)
42
- actionpack (= 5.2.3)
43
- activerecord (= 5.2.3)
41
+ activestorage (5.2.4.4)
42
+ actionpack (= 5.2.4.4)
43
+ activerecord (= 5.2.4.4)
44
44
  marcel (~> 0.3.1)
45
- activesupport (5.2.3)
45
+ activesupport (5.2.4.4)
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.4.0)
51
- algoliasearch (1.26.0)
50
+ addressable (2.7.0)
51
+ public_suffix (>= 2.0.2, < 5.0)
52
+ algoliasearch (1.27.5)
52
53
  httpclient (~> 2.8, >= 2.8.3)
53
54
  json (>= 1.5.1)
54
55
  arel (9.0.0)
55
- backports (3.15.0)
56
- builder (3.2.3)
56
+ builder (3.2.4)
57
57
  case_transform (0.2)
58
58
  activesupport
59
- concurrent-ruby (1.1.5)
60
- crass (1.0.4)
61
- diff-lcs (1.3)
62
- erubi (1.8.0)
63
- ethon (0.12.0)
64
- ffi (>= 1.3.0)
65
- faraday (0.15.4)
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)
66
64
  multipart-post (>= 1.2, < 3)
67
- faraday_middleware (0.13.1)
68
- faraday (>= 0.7.4, < 1.0)
69
- ffi (1.11.1)
70
- gh (0.15.1)
71
- addressable (~> 2.4.0)
72
- backports
73
- faraday (~> 0.8)
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)
74
73
  multi_json (~> 1.0)
75
74
  net-http-persistent (~> 2.9)
76
75
  net-http-pipeline
77
76
  globalid (0.4.2)
78
77
  activesupport (>= 4.2.0)
79
- highline (1.7.10)
78
+ highline (2.0.3)
80
79
  httpclient (2.8.3)
81
- i18n (1.6.0)
80
+ i18n (1.8.5)
82
81
  concurrent-ruby (~> 1.0)
83
82
  json (1.8.6)
83
+ json_pure (2.3.1)
84
84
  jsonapi-renderer (0.2.2)
85
- kaminari (1.1.1)
85
+ kaminari (1.2.1)
86
86
  activesupport (>= 4.1.0)
87
- kaminari-actionview (= 1.1.1)
88
- kaminari-activerecord (= 1.1.1)
89
- kaminari-core (= 1.1.1)
90
- kaminari-actionview (1.1.1)
87
+ kaminari-actionview (= 1.2.1)
88
+ kaminari-activerecord (= 1.2.1)
89
+ kaminari-core (= 1.2.1)
90
+ kaminari-actionview (1.2.1)
91
91
  actionview
92
- kaminari-core (= 1.1.1)
93
- kaminari-activerecord (1.1.1)
92
+ kaminari-core (= 1.2.1)
93
+ kaminari-activerecord (1.2.1)
94
94
  activerecord
95
- kaminari-core (= 1.1.1)
96
- kaminari-core (1.1.1)
95
+ kaminari-core (= 1.2.1)
96
+ kaminari-core (1.2.1)
97
97
  launchy (2.4.3)
98
98
  addressable (~> 2.3)
99
- loofah (2.2.3)
99
+ loofah (2.7.0)
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 (0.9.2)
107
- mimemagic (0.3.3)
108
- mini_mime (1.0.1)
106
+ method_source (1.0.0)
107
+ mimemagic (0.3.5)
108
+ mini_mime (1.0.2)
109
109
  mini_portile2 (2.4.0)
110
- minitest (5.11.3)
111
- multi_json (1.13.1)
110
+ minitest (5.14.2)
111
+ multi_json (1.15.0)
112
112
  multipart-post (2.1.1)
113
113
  net-http-persistent (2.9.4)
114
114
  net-http-pipeline (1.0.1)
115
- nio4r (2.3.1)
116
- nokogiri (1.10.3)
115
+ nio4r (2.5.4)
116
+ nokogiri (1.10.10)
117
117
  mini_portile2 (~> 2.4.0)
118
+ public_suffix (4.0.6)
118
119
  pusher-client (0.6.2)
119
120
  json
120
121
  websocket (~> 1.0)
121
- rack (2.0.7)
122
+ rack (2.2.3)
122
123
  rack-test (1.1.0)
123
124
  rack (>= 1.0, < 3)
124
- rails (5.2.3)
125
- actioncable (= 5.2.3)
126
- actionmailer (= 5.2.3)
127
- actionpack (= 5.2.3)
128
- actionview (= 5.2.3)
129
- activejob (= 5.2.3)
130
- activemodel (= 5.2.3)
131
- activerecord (= 5.2.3)
132
- activestorage (= 5.2.3)
133
- activesupport (= 5.2.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)
134
135
  bundler (>= 1.3.0)
135
- railties (= 5.2.3)
136
+ railties (= 5.2.4.4)
136
137
  sprockets-rails (>= 2.0.0)
137
138
  rails-dom-testing (2.0.3)
138
139
  activesupport (>= 4.2.0)
139
140
  nokogiri (>= 1.6)
140
- rails-html-sanitizer (1.0.4)
141
- loofah (~> 2.2, >= 2.2.2)
142
- railties (5.2.3)
143
- actionpack (= 5.2.3)
144
- activesupport (= 5.2.3)
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)
145
146
  method_source
146
147
  rake (>= 0.8.7)
147
148
  thor (>= 0.19.0, < 2.0)
148
149
  rake (10.1.1)
149
- rdoc (6.1.1)
150
+ rdoc (6.2.1)
150
151
  redgreen (1.2.2)
151
152
  rspec (2.99.0)
152
153
  rspec-core (~> 2.99.0)
@@ -156,35 +157,33 @@ GEM
156
157
  rspec-expectations (2.99.2)
157
158
  diff-lcs (>= 1.1.3, < 2.0)
158
159
  rspec-mocks (2.99.4)
159
- sequel (5.21.0)
160
- sprockets (3.7.2)
160
+ ruby2_keywords (0.0.2)
161
+ sequel (5.38.0)
162
+ sprockets (4.0.2)
161
163
  concurrent-ruby (~> 1.0)
162
164
  rack (> 1, < 3)
163
- sprockets-rails (3.2.1)
165
+ sprockets-rails (3.2.2)
164
166
  actionpack (>= 4.0)
165
167
  activesupport (>= 4.0)
166
168
  sprockets (>= 3.0.0)
167
169
  sqlite3 (1.3.13)
168
- thor (0.20.3)
170
+ thor (1.0.1)
169
171
  thread_safe (0.3.6)
170
- travis (1.8.10)
171
- backports
172
- faraday (~> 0.9)
173
- faraday_middleware (~> 0.9, >= 0.9.1)
172
+ travis (1.10.0)
173
+ faraday (~> 1.0)
174
+ faraday_middleware (~> 1.0)
174
175
  gh (~> 0.13)
175
- highline (~> 1.6)
176
- launchy (~> 2.1)
176
+ highline (~> 2.0)
177
+ json_pure (~> 2.3)
178
+ launchy (~> 2.1, < 2.5.0)
177
179
  pusher-client (~> 0.4)
178
- typhoeus (~> 0.6, >= 0.6.8)
179
- typhoeus (0.8.0)
180
- ethon (>= 0.8.0)
181
- tzinfo (1.2.5)
180
+ tzinfo (1.2.7)
182
181
  thread_safe (~> 0.1)
183
182
  websocket (1.2.8)
184
- websocket-driver (0.7.1)
183
+ websocket-driver (0.7.3)
185
184
  websocket-extensions (>= 0.1.0)
186
- websocket-extensions (0.1.4)
187
- will_paginate (3.1.7)
185
+ websocket-extensions (0.1.5)
186
+ will_paginate (3.3.0)
188
187
 
189
188
  PLATFORMS
190
189
  ruby
@@ -193,7 +192,7 @@ DEPENDENCIES
193
192
  active_model_serializers
194
193
  activerecord-jdbc-adapter
195
194
  activerecord-jdbcsqlite3-adapter
196
- algoliasearch (>= 1.17.0, < 2.0.0)
195
+ algoliasearch (>= 1.26.0, < 2.0.0)
197
196
  jdbc-sqlite3
198
197
  json (~> 1.8, >= 1.8.6)
199
198
  kaminari
@@ -208,4 +207,4 @@ DEPENDENCIES
208
207
  will_paginate (>= 2.3.15)
209
208
 
210
209
  BUNDLED WITH
211
- 2.0.1
210
+ 2.1.4
data/README.md CHANGED
@@ -1,9 +1,28 @@
1
-
2
- # Algolia Search API Client for Rails
3
-
4
- [Algolia Search](https://www.algolia.com) is a hosted search engine capable of delivering real-time results from the first keystroke.
5
-
6
- [![Build Status](https://travis-ci.org/algolia/algoliasearch-rails.svg?branch=master)](https://travis-ci.org/algolia/algoliasearch-rails) [![Gem Version](https://badge.fury.io/rb/algoliasearch-rails.svg)](http://badge.fury.io/rb/algoliasearch-rails) [![Code Climate](https://codeclimate.com/github/algolia/algoliasearch-rails.svg)](https://codeclimate.com/github/algolia/algoliasearch-rails) ![ActiveRecord](https://img.shields.io/badge/ActiveRecord-yes-blue.svg?style=flat-square) ![Mongoid](https://img.shields.io/badge/Mongoid-yes-blue.svg?style=flat-square) ![Sequel](https://img.shields.io/badge/Sequel-yes-blue.svg?style=flat-square)
1
+ <p align="center">
2
+ <a href="https://www.algolia.com">
3
+ <img alt="Algolia for Rails" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/rails.png" >
4
+ </a>
5
+
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
+
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>
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
+ <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
+ <img src="https://img.shields.io/badge/ActiveRecord-yes-blue.svg?style=flat-square" alt="ActiveRecord"></img>
13
+ <img src="https://img.shields.io/badge/Mongoid-yes-blue.svg?style=flat-square" alt="Mongoid"></img>
14
+ <img src="https://img.shields.io/badge/Sequel-yes-blue.svg?style=flat-square" alt="Sequel"></img>
15
+ </p>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://www.algolia.com/doc/framework-integration/rails/getting-started/setup/?language=ruby" target="_blank">Documentation</a> •
20
+ <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
21
+ <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
22
+ <a href="https://github.com/algolia/algoliasearch-rails/issues" target="_blank">Report a bug</a> •
23
+ <a href="https://www.algolia.com/doc/framework-integration/rails/troubleshooting/faq/" target="_blank">FAQ</a> •
24
+ <a href="https://www.algolia.com/support" target="_blank">Support</a>
25
+ </p>
7
26
 
8
27
 
9
28
  This gem let you easily integrate the Algolia Search API to your favorite ORM. It's based on the [algoliasearch-client-ruby](https://github.com/algolia/algoliasearch-client-ruby) gem.
@@ -64,6 +83,8 @@ You can find the full reference on [Algolia's website](https://www.algolia.com/d
64
83
  1. **[Testing](#testing)**
65
84
  * [Notes](#notes)
66
85
 
86
+ 1. **[Troubleshooting](#troubleshooting)**
87
+ * [Frequently asked questions](#frequently-asked-questions)
67
88
 
68
89
 
69
90
 
@@ -142,7 +163,7 @@ class Contact < ActiveRecord::Base
142
163
  include AlgoliaSearch
143
164
 
144
165
  algoliasearch do
145
- attribute :first_name, :last_name, :email
166
+ attributes :first_name, :last_name, :email
146
167
  end
147
168
  end
148
169
  ```
@@ -1163,4 +1184,11 @@ end
1163
1184
  ```
1164
1185
 
1165
1186
 
1187
+ ## ❓ Troubleshooting
1188
+
1189
+ Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/ruby/) where you will find answers for the most common issues and gotchas with the client.
1190
+
1191
+ ## Use the Dockerfile
1192
+
1193
+ If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our [dedicated guide](DOCKER_README.MD) to learn more.
1166
1194
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.description = "AlgoliaSearch integration to your favorite ORM"
15
15
  s.email = "contact@algolia.com"
16
16
  s.extra_rdoc_files = [
17
- "ChangeLog",
17
+ "CHANGELOG.MD",
18
18
  "LICENSE",
19
19
  "README.md"
20
20
  ]
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  ".document",
23
23
  ".rspec",
24
24
  ".travis.yml",
25
- "ChangeLog",
25
+ "CHANGELOG.MD",
26
26
  "Gemfile",
27
27
  "Gemfile.lock",
28
28
  "LICENSE",
@@ -79,7 +79,7 @@ Gem::Specification.new do |s|
79
79
 
80
80
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
81
81
  s.add_runtime_dependency(%q<json>, [">= 1.5.1"])
82
- s.add_runtime_dependency(%q<algoliasearch>, [">= 1.17.0", "< 2.0.0"])
82
+ s.add_runtime_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
83
83
  s.add_development_dependency(%q<will_paginate>, [">= 2.3.15"])
84
84
  s.add_development_dependency(%q<kaminari>, [">= 0"])
85
85
  s.add_development_dependency "travis"
@@ -87,11 +87,11 @@ Gem::Specification.new do |s|
87
87
  s.add_development_dependency "rdoc"
88
88
  else
89
89
  s.add_dependency(%q<json>, [">= 1.5.1"])
90
- s.add_dependency(%q<algoliasearch>, [">= 1.17.0", "< 2.0.0"])
90
+ s.add_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
91
91
  end
92
92
  else
93
93
  s.add_dependency(%q<json>, [">= 1.5.1"])
94
- s.add_dependency(%q<algoliasearch>, [">= 1.17.0", "< 2.0.0"])
94
+ s.add_dependency(%q<algoliasearch>, [">= 1.26.0", "< 2.0.0"])
95
95
  end
96
96
  end
97
97
 
@@ -68,7 +68,7 @@ module AlgoliaSearch
68
68
  :disableTypoToleranceOnAttributes, :disableTypoToleranceOnWords, :separatorsToIndex,
69
69
  # Language
70
70
  :ignorePlurals, :removeStopWords, :camelCaseAttributes, :decompoundedAttributes,
71
- :keepDiacriticsOnCharacters, :queryLanguages,
71
+ :keepDiacriticsOnCharacters, :queryLanguages, :indexLanguages,
72
72
  # Query Rules
73
73
  :enableRules,
74
74
  # Query Strategy
@@ -90,9 +90,9 @@ module AlgoliaSearch
90
90
  end
91
91
  end
92
92
 
93
- def initialize(options, block)
93
+ def initialize(options, &block)
94
94
  @options = options
95
- instance_exec(&block) if block
95
+ instance_exec(&block) if block_given?
96
96
  end
97
97
 
98
98
  def use_serializer(serializer)
@@ -223,10 +223,10 @@ module AlgoliaSearch
223
223
  end
224
224
  end
225
225
 
226
- def geoloc(lat_attr, lng_attr)
226
+ def geoloc(lat_attr = nil, lng_attr = nil, &block)
227
227
  raise ArgumentError.new('Cannot specify additional attributes on a replica index') if @options[:slave] || @options[:replica]
228
228
  add_attribute :_geoloc do |o|
229
- { :lat => o.send(lat_attr).to_f, :lng => o.send(lng_attr).to_f }
229
+ block_given? ? o.instance_eval(&block) : { :lat => o.send(lat_attr).to_f, :lng => o.send(lng_attr).to_f }
230
230
  end
231
231
  end
232
232
 
@@ -272,7 +272,7 @@ module AlgoliaSearch
272
272
  @additional_indexes ||= {}
273
273
  raise MixedSlavesAndReplicas.new('Cannot mix slaves and replicas in the same configuration (add_slave is deprecated)') if (options[:slave] && @additional_indexes.any? { |opts, _| opts[:replica] }) || (options[:replica] && @additional_indexes.any? { |opts, _| opts[:slave] })
274
274
  options[:index_name] = index_name
275
- @additional_indexes[options] = IndexSettings.new(options, Proc.new)
275
+ @additional_indexes[options] = IndexSettings.new(options, &block)
276
276
  end
277
277
 
278
278
  def add_replica(index_name, options = {}, &block)
@@ -389,7 +389,7 @@ module AlgoliaSearch
389
389
  end
390
390
 
391
391
  def algoliasearch(options = {}, &block)
392
- self.algoliasearch_settings = IndexSettings.new(options, block_given? ? Proc.new : nil)
392
+ self.algoliasearch_settings = IndexSettings.new(options, &block)
393
393
  self.algoliasearch_options = { :type => algolia_full_const_get(model_name.to_s), :per_page => algoliasearch_settings.get_setting(:hitsPerPage) || 10, :page => 1 }.merge(options)
394
394
 
395
395
  attr_accessor :highlight_result, :snippet_result
@@ -555,14 +555,21 @@ module AlgoliaSearch
555
555
  master_settings.delete 'replicas'
556
556
 
557
557
  # init temporary index
558
- index_name = algolia_index_name(options)
559
- tmp_options = options.merge({ :index_name => "#{index_name}.tmp" })
558
+ src_index_name = algolia_index_name(options)
559
+ tmp_index_name = "#{src_index_name}.tmp"
560
+ tmp_options = options.merge({ :index_name => tmp_index_name })
560
561
  tmp_options.delete(:per_environment) # already included in the temporary index_name
561
562
  tmp_settings = settings.dup
562
- tmp_index = algolia_ensure_init(tmp_options, tmp_settings, master_settings)
563
563
 
564
- algolia_find_in_batches(batch_size) do |group|
565
- if algolia_conditional_index?(tmp_options)
564
+ if options[:check_settings] == false
565
+ ::Algolia::copy_index!(src_index_name, tmp_index_name, %w(settings synonyms rules))
566
+ tmp_index = SafeIndex.new(tmp_index_name, !!options[:raise_on_failure])
567
+ else
568
+ tmp_index = algolia_ensure_init(tmp_options, tmp_settings, master_settings)
569
+ end
570
+
571
+ algolia_find_in_batches(batch_size) do |group|
572
+ if algolia_conditional_index?(options)
566
573
  # select only indexable objects
567
574
  group = group.select { |o| algolia_indexable?(o, tmp_options) }
568
575
  end
@@ -570,7 +577,7 @@ module AlgoliaSearch
570
577
  tmp_index.save_objects(objects)
571
578
  end
572
579
 
573
- move_task = SafeIndex.move_index(tmp_index.name, index_name)
580
+ move_task = SafeIndex.move_index(tmp_index.name, src_index_name)
574
581
  master_index.wait_task(move_task["taskID"]) if synchronous || options[:synchronous]
575
582
  end
576
583
  nil
@@ -6,7 +6,7 @@ module AlgoliaSearch
6
6
 
7
7
  def configuration=(configuration)
8
8
  @@configuration = configuration.merge(
9
- :user_agent => "Algolia for Rails (#{AlgoliaSearch::VERSION}); Rails (#{Rails::VERSION})"
9
+ :user_agent => "Algolia for Rails (#{AlgoliaSearch::VERSION}); Rails (#{Rails::VERSION::STRING})"
10
10
  )
11
11
  Algolia.init @@configuration
12
12
  end
@@ -2,7 +2,11 @@ module AlgoliaSearch
2
2
  module Utilities
3
3
  class << self
4
4
  def get_model_classes
5
- Rails.application.eager_load! if Rails.application # Ensure all models are loaded (not necessary in production when cache_classes is true).
5
+ if defined?(Rails.autoloaders) && Rails.autoloaders.zeitwerk_enabled?
6
+ Zeitwerk::Loader.eager_load_all
7
+ elsif Rails.application
8
+ Rails.application.eager_load!
9
+ end
6
10
  AlgoliaSearch.instance_variable_get :@included_in
7
11
  end
8
12
 
@@ -1,3 +1,3 @@
1
1
  module AlgoliaSearch
2
- VERSION = '1.23.0'
2
+ VERSION = '1.25.0'
3
3
  end
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.23.0
4
+ version: 1.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-25 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.17.0
33
+ version: 1.26.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.17.0
43
+ version: 1.26.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.0.0
@@ -119,14 +119,14 @@ email: contact@algolia.com
119
119
  executables: []
120
120
  extensions: []
121
121
  extra_rdoc_files:
122
- - ChangeLog
122
+ - CHANGELOG.MD
123
123
  - LICENSE
124
124
  - README.md
125
125
  files:
126
126
  - ".document"
127
127
  - ".rspec"
128
128
  - ".travis.yml"
129
- - ChangeLog
129
+ - CHANGELOG.MD
130
130
  - Gemfile
131
131
  - Gemfile.lock
132
132
  - LICENSE
@@ -173,7 +173,7 @@ homepage: http://github.com/algolia/algoliasearch-rails
173
173
  licenses:
174
174
  - MIT
175
175
  metadata: {}
176
- post_install_message:
176
+ post_install_message:
177
177
  rdoc_options: []
178
178
  require_paths:
179
179
  - lib
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubygems_version: 3.0.3
192
- signing_key:
192
+ signing_key:
193
193
  specification_version: 4
194
194
  summary: AlgoliaSearch integration to your favorite ORM
195
195
  test_files: []