algoliasearch-rails 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc15b367cfcf9859a354bc12cc93aa844e32c88147d929a71ed7a9913ced85b4
4
- data.tar.gz: 3bdc03e4a7644dbfe306c6d9748c20f8b95e916bd4185059712f735050ed10f6
3
+ metadata.gz: 91a3c57ba564afcd15833841c0c4dad105b1889179281b43e59a1adcb5c3acd2
4
+ data.tar.gz: d8bdac6cdf53cb6f095e1d485c6ceff1d94a17c6d649d76cefd29dca37d65172
5
5
  SHA512:
6
- metadata.gz: a1527739dd334bbedce3883a5f664534d91a35ce6948f752e90bd77e418302660e9a3cabbf0f2e67d900bff1335bbad95c047b8954563f278dbf629dc8fac8d5
7
- data.tar.gz: 86b196e2196d3730e90a34cbfad5bb32022fdb94ee5160471f1c2b79e8f1302d2095f50a1376b292b613803542767b237fdab70f10c90811ae6c52a0a91ef94a
6
+ metadata.gz: 13fe3ebce7b706de4324f0ee1f5fea8fdcfb6913445cc56a24a337868ac9f98edd173b5559a58921b73156d1dfe5d56fd3bd302666923966e5a1c4328369b5ec
7
+ data.tar.gz: f6237c40c513bacdb78ebd307668c0ae478c4e20f600a5d9ac10ca164ab2082e9515d9061177e5b93faf9ffebafbe4c864f80851c9466ac23565f4a7dadc83b4
data/CHANGELOG.MD CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/algolia/algoliasearch-rails/compare/2.2.1...master)
4
4
 
5
+ ## [2.2.2](https://github.com/algolia/algoliasearch-rails/compare/2.2.2...2.3.0)
6
+ ### Fixed
7
+ * bugfix: don't consider objectID changed when using custom ID through method [`#436`](https://github.com/algolia/algoliasearch-rails/pull/436)
8
+
5
9
  ## [2.2.2](https://github.com/algolia/algoliasearch-rails/compare/2.2.1...2.2.2)
6
10
  ### Fixed
7
11
  * fix: wrong method name [`#429`](https://github.com/algolia/algoliasearch-rails/pull/429)
data/Gemfile.lock CHANGED
@@ -1,47 +1,40 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actioncable (7.0.4.2)
5
- actionpack (= 7.0.4.2)
6
- activesupport (= 7.0.4.2)
4
+ actioncable (6.1.4.7)
5
+ actionpack (= 6.1.4.7)
6
+ activesupport (= 6.1.4.7)
7
7
  nio4r (~> 2.0)
8
8
  websocket-driver (>= 0.6.1)
9
- actionmailbox (7.0.4.2)
10
- actionpack (= 7.0.4.2)
11
- activejob (= 7.0.4.2)
12
- activerecord (= 7.0.4.2)
13
- activestorage (= 7.0.4.2)
14
- activesupport (= 7.0.4.2)
9
+ actionmailbox (6.1.4.7)
10
+ actionpack (= 6.1.4.7)
11
+ activejob (= 6.1.4.7)
12
+ activerecord (= 6.1.4.7)
13
+ activestorage (= 6.1.4.7)
14
+ activesupport (= 6.1.4.7)
15
15
  mail (>= 2.7.1)
16
- net-imap
17
- net-pop
18
- net-smtp
19
- actionmailer (7.0.4.2)
20
- actionpack (= 7.0.4.2)
21
- actionview (= 7.0.4.2)
22
- activejob (= 7.0.4.2)
23
- activesupport (= 7.0.4.2)
16
+ actionmailer (6.1.4.7)
17
+ actionpack (= 6.1.4.7)
18
+ actionview (= 6.1.4.7)
19
+ activejob (= 6.1.4.7)
20
+ activesupport (= 6.1.4.7)
24
21
  mail (~> 2.5, >= 2.5.4)
25
- net-imap
26
- net-pop
27
- net-smtp
28
22
  rails-dom-testing (~> 2.0)
29
- actionpack (7.0.4.2)
30
- actionview (= 7.0.4.2)
31
- activesupport (= 7.0.4.2)
32
- rack (~> 2.0, >= 2.2.0)
23
+ actionpack (6.1.4.7)
24
+ actionview (= 6.1.4.7)
25
+ activesupport (= 6.1.4.7)
26
+ rack (~> 2.0, >= 2.0.9)
33
27
  rack-test (>= 0.6.3)
34
28
  rails-dom-testing (~> 2.0)
35
29
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (7.0.4.2)
37
- actionpack (= 7.0.4.2)
38
- activerecord (= 7.0.4.2)
39
- activestorage (= 7.0.4.2)
40
- activesupport (= 7.0.4.2)
41
- globalid (>= 0.6.0)
30
+ actiontext (6.1.4.7)
31
+ actionpack (= 6.1.4.7)
32
+ activerecord (= 6.1.4.7)
33
+ activestorage (= 6.1.4.7)
34
+ activesupport (= 6.1.4.7)
42
35
  nokogiri (>= 1.8.5)
43
- actionview (7.0.4.2)
44
- activesupport (= 7.0.4.2)
36
+ actionview (6.1.4.7)
37
+ activesupport (= 6.1.4.7)
45
38
  builder (~> 3.1)
46
39
  erubi (~> 1.4)
47
40
  rails-dom-testing (~> 2.0)
@@ -51,27 +44,28 @@ GEM
51
44
  activemodel (>= 4.1, < 7.1)
52
45
  case_transform (>= 0.2)
53
46
  jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
54
- activejob (7.0.4.2)
55
- activesupport (= 7.0.4.2)
47
+ activejob (6.1.4.7)
48
+ activesupport (= 6.1.4.7)
56
49
  globalid (>= 0.3.6)
57
- activemodel (7.0.4.2)
58
- activesupport (= 7.0.4.2)
59
- activerecord (7.0.4.2)
60
- activemodel (= 7.0.4.2)
61
- activesupport (= 7.0.4.2)
62
- activestorage (7.0.4.2)
63
- actionpack (= 7.0.4.2)
64
- activejob (= 7.0.4.2)
65
- activerecord (= 7.0.4.2)
66
- activesupport (= 7.0.4.2)
67
- marcel (~> 1.0)
50
+ activemodel (6.1.4.7)
51
+ activesupport (= 6.1.4.7)
52
+ activerecord (6.1.4.7)
53
+ activemodel (= 6.1.4.7)
54
+ activesupport (= 6.1.4.7)
55
+ activestorage (6.1.4.7)
56
+ actionpack (= 6.1.4.7)
57
+ activejob (= 6.1.4.7)
58
+ activerecord (= 6.1.4.7)
59
+ activesupport (= 6.1.4.7)
60
+ marcel (~> 1.0.0)
68
61
  mini_mime (>= 1.1.0)
69
- activesupport (7.0.4.2)
62
+ activesupport (6.1.4.7)
70
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
71
64
  i18n (>= 1.6, < 2)
72
65
  minitest (>= 5.1)
73
66
  tzinfo (~> 2.0)
74
- algolia (2.3.1)
67
+ zeitwerk (~> 2.3)
68
+ algolia (2.3.2)
75
69
  faraday (>= 0.15, < 3)
76
70
  faraday-net_http_persistent (>= 0.15, < 3)
77
71
  multi_json (~> 1.0)
@@ -79,13 +73,13 @@ GEM
79
73
  builder (3.2.4)
80
74
  case_transform (0.2)
81
75
  activesupport
82
- concurrent-ruby (1.2.0)
83
- connection_pool (2.3.0)
76
+ concurrent-ruby (1.2.2)
77
+ connection_pool (2.4.1)
84
78
  crass (1.0.6)
85
79
  date (3.3.3)
86
80
  diff-lcs (1.5.0)
87
81
  erubi (1.12.0)
88
- faraday (2.7.4)
82
+ faraday (2.7.10)
89
83
  faraday-net_http (>= 2.0, < 3.1)
90
84
  ruby2_keywords (>= 0.0.4)
91
85
  faraday-net_http (3.0.2)
@@ -94,16 +88,16 @@ GEM
94
88
  net-http-persistent (~> 4.0)
95
89
  globalid (1.1.0)
96
90
  activesupport (>= 5.0)
97
- i18n (1.12.0)
91
+ i18n (1.14.1)
98
92
  concurrent-ruby (~> 1.0)
99
93
  json (2.6.3)
100
94
  jsonapi-renderer (0.2.2)
101
95
  kaminari (0.17.0)
102
96
  actionpack (>= 3.0.0)
103
97
  activesupport (>= 3.0.0)
104
- loofah (2.19.1)
98
+ loofah (2.21.3)
105
99
  crass (~> 1.0.2)
106
- nokogiri (>= 1.5.9)
100
+ nokogiri (>= 1.12.0)
107
101
  mail (2.8.1)
108
102
  mini_mime (>= 0.1.1)
109
103
  net-imap
@@ -111,13 +105,13 @@ GEM
111
105
  net-smtp
112
106
  marcel (1.0.2)
113
107
  method_source (1.0.0)
114
- mini_mime (1.1.2)
115
- mini_portile2 (2.8.1)
116
- minitest (5.17.0)
108
+ mini_mime (1.1.5)
109
+ mini_portile2 (2.8.4)
110
+ minitest (5.19.0)
117
111
  multi_json (1.15.0)
118
- net-http-persistent (4.0.1)
112
+ net-http-persistent (4.0.2)
119
113
  connection_pool (~> 2.2)
120
- net-imap (0.3.4)
114
+ net-imap (0.3.7)
121
115
  date
122
116
  net-protocol
123
117
  net-pop (0.1.2)
@@ -126,72 +120,75 @@ GEM
126
120
  timeout
127
121
  net-smtp (0.3.3)
128
122
  net-protocol
129
- nio4r (2.5.8)
130
- nokogiri (1.14.2)
123
+ nio4r (2.5.9)
124
+ nokogiri (1.13.10)
131
125
  mini_portile2 (~> 2.8.0)
132
126
  racc (~> 1.4)
133
127
  psych (5.1.0)
134
128
  stringio
135
- racc (1.6.2)
136
- rack (2.2.6.2)
137
- rack-test (2.0.2)
129
+ racc (1.7.1)
130
+ rack (2.2.8)
131
+ rack-test (2.1.0)
138
132
  rack (>= 1.3)
139
- rails (7.0.4.2)
140
- actioncable (= 7.0.4.2)
141
- actionmailbox (= 7.0.4.2)
142
- actionmailer (= 7.0.4.2)
143
- actionpack (= 7.0.4.2)
144
- actiontext (= 7.0.4.2)
145
- actionview (= 7.0.4.2)
146
- activejob (= 7.0.4.2)
147
- activemodel (= 7.0.4.2)
148
- activerecord (= 7.0.4.2)
149
- activestorage (= 7.0.4.2)
150
- activesupport (= 7.0.4.2)
133
+ rails (6.1.4.7)
134
+ actioncable (= 6.1.4.7)
135
+ actionmailbox (= 6.1.4.7)
136
+ actionmailer (= 6.1.4.7)
137
+ actionpack (= 6.1.4.7)
138
+ actiontext (= 6.1.4.7)
139
+ actionview (= 6.1.4.7)
140
+ activejob (= 6.1.4.7)
141
+ activemodel (= 6.1.4.7)
142
+ activerecord (= 6.1.4.7)
143
+ activestorage (= 6.1.4.7)
144
+ activesupport (= 6.1.4.7)
151
145
  bundler (>= 1.15.0)
152
- railties (= 7.0.4.2)
153
- rails-dom-testing (2.0.3)
154
- activesupport (>= 4.2.0)
146
+ railties (= 6.1.4.7)
147
+ sprockets-rails (>= 2.0.0)
148
+ rails-dom-testing (2.2.0)
149
+ activesupport (>= 5.0.0)
150
+ minitest
155
151
  nokogiri (>= 1.6)
156
152
  rails-html-sanitizer (1.5.0)
157
153
  loofah (~> 2.19, >= 2.19.1)
158
- railties (7.0.4.2)
159
- actionpack (= 7.0.4.2)
160
- activesupport (= 7.0.4.2)
154
+ railties (6.1.4.7)
155
+ actionpack (= 6.1.4.7)
156
+ activesupport (= 6.1.4.7)
161
157
  method_source
162
- rake (>= 12.2)
158
+ rake (>= 0.13)
163
159
  thor (~> 1.0)
164
- zeitwerk (~> 2.5)
165
- rake (12.3.3)
160
+ rake (10.1.1)
166
161
  rdoc (6.5.0)
167
162
  psych (>= 4.0.0)
168
163
  redgreen (1.2.2)
169
- rspec (3.12.0)
170
- rspec-core (~> 3.12.0)
171
- rspec-expectations (~> 3.12.0)
172
- rspec-mocks (~> 3.12.0)
173
- rspec-core (3.12.1)
174
- rspec-support (~> 3.12.0)
175
- rspec-expectations (3.12.2)
176
- diff-lcs (>= 1.2.0, < 2.0)
177
- rspec-support (~> 3.12.0)
178
- rspec-mocks (3.12.3)
179
- diff-lcs (>= 1.2.0, < 2.0)
180
- rspec-support (~> 3.12.0)
181
- rspec-support (3.12.0)
164
+ rspec (2.99.0)
165
+ rspec-core (~> 2.99.0)
166
+ rspec-expectations (~> 2.99.0)
167
+ rspec-mocks (~> 2.99.0)
168
+ rspec-core (2.99.2)
169
+ rspec-expectations (2.99.2)
170
+ diff-lcs (>= 1.1.3, < 2.0)
171
+ rspec-mocks (2.99.4)
182
172
  ruby2_keywords (0.0.5)
183
- sequel (5.65.0)
173
+ sequel (5.71.0)
174
+ sprockets (4.2.0)
175
+ concurrent-ruby (~> 1.0)
176
+ rack (>= 2.2.4, < 4)
177
+ sprockets-rails (3.4.2)
178
+ actionpack (>= 5.2)
179
+ activesupport (>= 5.2)
180
+ sprockets (>= 3.0.0)
184
181
  sqlite3 (1.4.4)
185
- stringio (3.0.5)
186
- thor (1.2.1)
187
- timeout (0.3.2)
182
+ stringio (3.0.6)
183
+ thor (1.2.2)
184
+ timeout (0.4.0)
188
185
  tzinfo (2.0.6)
189
186
  concurrent-ruby (~> 1.0)
190
- websocket-driver (0.7.5)
187
+ websocket-driver (0.7.6)
191
188
  websocket-extensions (>= 0.1.0)
192
189
  websocket-extensions (0.1.5)
193
- will_paginate (3.3.1)
194
- zeitwerk (2.6.7)
190
+ will_paginate (4.0.0)
191
+ zeitwerk (2.6.11)
195
192
 
196
193
  PLATFORMS
197
194
  ruby
@@ -204,13 +201,12 @@ DEPENDENCIES
204
201
  jdbc-sqlite3
205
202
  json (>= 1.5.1)
206
203
  kaminari (< 1)
207
- rails (~> 7.0)
208
- rails-html-sanitizer
209
- rake (~> 12.2)
204
+ rails (~> 6.1)
205
+ rake (~> 10.1.0)
210
206
  rdoc
211
207
  redgreen
212
- rspec (~> 3.0)
213
- sequel (~> 5.0)
208
+ rspec (>= 2.5.0, < 3.0)
209
+ sequel (>= 4.0)
214
210
  sqlite3 (~> 1.4.0)
215
211
  will_paginate (>= 2.3.15)
216
212
 
@@ -1,3 +1,3 @@
1
1
  module AlgoliaSearch
2
- VERSION = '2.2.2'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -753,14 +753,13 @@ module AlgoliaSearch
753
753
  next if options[:replica]
754
754
  return true if algolia_object_id_changed?(object, options)
755
755
  settings.get_attribute_names(object).each do |k|
756
- return true if algolia_attribute_changed?(object, k)
757
- # return true if !object.respond_to?(changed_method) || object.send(changed_method)
756
+ return true if algolia_attribute_changed?(object, k, true)
758
757
  end
759
758
  [options[:if], options[:unless]].each do |condition|
760
759
  case condition
761
760
  when nil
762
761
  when String, Symbol
763
- return true if algolia_attribute_changed?(object, condition)
762
+ return true if algolia_attribute_changed?(object, condition, true)
764
763
  else
765
764
  # if the :if, :unless condition is a anything else,
766
765
  # we have no idea whether we should reindex or not
@@ -837,7 +836,7 @@ module AlgoliaSearch
837
836
  end
838
837
 
839
838
  def algolia_object_id_changed?(o, options = nil)
840
- changed = algolia_attribute_changed?(o, algolia_object_id_method(options))
839
+ changed = algolia_attribute_changed?(o, algolia_object_id_method(options), false)
841
840
  changed.nil? ? false : changed
842
841
  end
843
842
 
@@ -934,7 +933,7 @@ module AlgoliaSearch
934
933
  end
935
934
  end
936
935
 
937
- def algolia_attribute_changed?(object, attr_name)
936
+ def algolia_attribute_changed?(object, attr_name, default)
938
937
  # if one of two method is implemented, we return its result
939
938
  # true/false means whether it has changed or not
940
939
  # +#{attr_name}_changed?+ always defined for automatic attributes but deprecated after Rails 5.2
@@ -963,8 +962,8 @@ module AlgoliaSearch
963
962
  return object.send("will_save_change_to_#{attr_name}?")
964
963
  end
965
964
 
966
- # We don't know if the attribute has changed, so conservatively assume it has
967
- true
965
+ # We don't know if the attribute has changed, so return the default passed
966
+ default
968
967
  end
969
968
 
970
969
  def automatic_changed_method?(object, method_name)
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: 2.2.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json