sunspot_rails 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +1 -0
- data/lib/sunspot/rails/searchable.rb +6 -4
- data/lib/sunspot/rails/stub_session_proxy.rb +5 -2
- data/lib/sunspot/rails/tasks.rb +0 -1
- data/spec/rails_app/config/application.rb +3 -0
- data/spec/rails_app/vendor/engines/test_engine/app/models/test_engine/rake_task_auto_load_test_model.rb +15 -0
- data/spec/rails_app/vendor/engines/test_engine/lib/test_engine/engine.rb +5 -0
- data/spec/rails_app/vendor/engines/test_engine/lib/test_engine.rb +4 -0
- data/spec/rake_task_spec.rb +2 -2
- data/sunspot_rails.gemspec +0 -2
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d24337902829c8c14a7ea0d9f081c7392b457e0604ff78887ed67037fcedc5
|
4
|
+
data.tar.gz: 77c235ecfc5bc55c4758abece0d0336bc0c541bf6461d5f134b7bec57eec3c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3a95a7312b3dd3b3402fee02ff137c85b357cf17c1babf7c98f5a37456515882d5e8978729d368b42fa67c4163d02704b7540f9878cd4dd9d09cde22f78f1b8
|
7
|
+
data.tar.gz: 3b031829d6bfac5ee89d7cc33ebc76375614e4ac21f9b1864b55d313a537d08a4ef96cd57d60cc41fabc5eca589a2e42052169172c77756adf382aac7e108dae
|
data/Appraisals
CHANGED
@@ -57,6 +57,7 @@ if ruby_version >= Gem::Version.new('2.2.0')
|
|
57
57
|
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
58
58
|
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
59
59
|
gem 'rails', "~> #{rails_version}"
|
60
|
+
gem 'sprockets', '~> 3.0'
|
60
61
|
gem 'progress_bar', '~> 1.0.5', require: false
|
61
62
|
end
|
62
63
|
end
|
@@ -264,7 +264,7 @@ module Sunspot #:nodoc:
|
|
264
264
|
|
265
265
|
if options[:batch_size].to_i > 0
|
266
266
|
batch_counter = 0
|
267
|
-
self.includes(options[:include]).find_in_batches(options.slice(:batch_size, :start)) do |records|
|
267
|
+
self.includes(options[:include]).find_in_batches(**options.slice(:batch_size, :start)) do |records|
|
268
268
|
|
269
269
|
solr_benchmark(options[:batch_size], batch_counter += 1) do
|
270
270
|
Sunspot.index(records.select(&:indexable?))
|
@@ -287,7 +287,7 @@ module Sunspot #:nodoc:
|
|
287
287
|
#
|
288
288
|
# ==== Updates (passed as a hash)
|
289
289
|
#
|
290
|
-
# updates should be specified as a hash, where key - is the object ID
|
290
|
+
# updates should be specified as a hash, where key - is the object or the object ID
|
291
291
|
# and values is hash with property name/values to be updated.
|
292
292
|
#
|
293
293
|
# ==== Examples
|
@@ -303,6 +303,8 @@ module Sunspot #:nodoc:
|
|
303
303
|
#
|
304
304
|
# # update single property
|
305
305
|
# Post.atomic_update(post1.id => {description: 'New post description'})
|
306
|
+
# Or
|
307
|
+
# Post.atomic_update(post1 => {description: 'New post description'})
|
306
308
|
#
|
307
309
|
# ==== Notice
|
308
310
|
# all non-stored properties in Solr index will be lost after update.
|
@@ -453,7 +455,7 @@ module Sunspot #:nodoc:
|
|
453
455
|
# you only need to pass hash with property changes
|
454
456
|
#
|
455
457
|
def solr_atomic_update(updates = {})
|
456
|
-
Sunspot.atomic_update(self.class, self
|
458
|
+
Sunspot.atomic_update(self.class, self => updates)
|
457
459
|
end
|
458
460
|
|
459
461
|
#
|
@@ -461,7 +463,7 @@ module Sunspot #:nodoc:
|
|
461
463
|
# See #solr_atomic_update
|
462
464
|
#
|
463
465
|
def solr_atomic_update!(updates = {})
|
464
|
-
Sunspot.atomic_update!(self.class, self
|
466
|
+
Sunspot.atomic_update!(self.class, self => updates)
|
465
467
|
end
|
466
468
|
|
467
469
|
#
|
@@ -108,7 +108,7 @@ module Sunspot
|
|
108
108
|
[]
|
109
109
|
end
|
110
110
|
|
111
|
-
def facet(name)
|
111
|
+
def facet(name, dynamic_name = nil)
|
112
112
|
FacetStub.new
|
113
113
|
end
|
114
114
|
|
@@ -127,6 +127,9 @@ module Sunspot
|
|
127
127
|
def execute
|
128
128
|
self
|
129
129
|
end
|
130
|
+
|
131
|
+
def spellcheck_collation
|
132
|
+
end
|
130
133
|
end
|
131
134
|
|
132
135
|
|
@@ -223,7 +226,7 @@ module Sunspot
|
|
223
226
|
[]
|
224
227
|
end
|
225
228
|
|
226
|
-
def facet(name)
|
229
|
+
def facet(name, dynamic_name = nil)
|
227
230
|
FacetStub.new
|
228
231
|
end
|
229
232
|
|
data/lib/sunspot/rails/tasks.rb
CHANGED
@@ -31,7 +31,6 @@ namespace :sunspot do
|
|
31
31
|
# Load all the application's models. Models which invoke 'searchable' will register themselves
|
32
32
|
# in Sunspot.searchable.
|
33
33
|
Rails.application.eager_load!
|
34
|
-
Rails::Engine.subclasses.each{|engine| engine.instance.eager_load!}
|
35
34
|
|
36
35
|
if args[:models].present?
|
37
36
|
# Choose a specific subset of models, if requested
|
@@ -4,6 +4,9 @@ require 'rails/all'
|
|
4
4
|
|
5
5
|
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
6
6
|
|
7
|
+
# Load the test engine
|
8
|
+
require File.expand_path('../../vendor/engines/test_engine/lib/test_engine', __FILE__)
|
9
|
+
|
7
10
|
module RailsApp
|
8
11
|
class Application < Rails::Application
|
9
12
|
config.encoding = 'utf-8'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This model should not be used for any test other than the spec test that
|
2
|
+
# checks if all models are loaded. We don't want to pre-load this model in
|
3
|
+
# another test because we're checking to see if it will be auto-loaded by
|
4
|
+
# the reindex task
|
5
|
+
module TestEngine
|
6
|
+
class RakeTaskAutoLoadTestModel < ActiveRecord::Base
|
7
|
+
def self.table_name
|
8
|
+
'posts'
|
9
|
+
end
|
10
|
+
|
11
|
+
searchable do
|
12
|
+
string :name
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/spec/rake_task_spec.rb
CHANGED
@@ -11,8 +11,8 @@ describe 'sunspot namespace rake task' do
|
|
11
11
|
it "should reindex all models if none are specified" do
|
12
12
|
run_rake_task("sunspot:reindex", '', '', true)
|
13
13
|
|
14
|
-
# This
|
15
|
-
expect(Sunspot.searchable.collect(&:name)).to include('RakeTaskAutoLoadTestModel')
|
14
|
+
# This models should not be used by any other test and therefore should only be loaded by this test
|
15
|
+
expect(Sunspot.searchable.collect(&:name)).to include('RakeTaskAutoLoadTestModel', 'TestEngine::RakeTaskAutoLoadTestModel')
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should accept a space delimited list of models to reindex" do
|
data/sunspot_rails.gemspec
CHANGED
@@ -25,8 +25,6 @@ Gem::Specification.new do |s|
|
|
25
25
|
Rails request.
|
26
26
|
TEXT
|
27
27
|
|
28
|
-
s.rubyforge_project = "sunspot"
|
29
|
-
|
30
28
|
s.files = `git ls-files`.split("\n")
|
31
29
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
32
30
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -23,10 +23,10 @@ authors:
|
|
23
23
|
- Sam Granieri
|
24
24
|
- Nick Zadrozny
|
25
25
|
- Jason Ronallo
|
26
|
-
autorequire:
|
26
|
+
autorequire:
|
27
27
|
bindir: bin
|
28
28
|
cert_chain: []
|
29
|
-
date:
|
29
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
30
30
|
dependencies:
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: rails
|
@@ -48,14 +48,14 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - '='
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 2.
|
51
|
+
version: 2.6.0
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - '='
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version: 2.
|
58
|
+
version: 2.6.0
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: appraisal
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,6 +201,9 @@ files:
|
|
201
201
|
- spec/rails_app/config/routes.rb
|
202
202
|
- spec/rails_app/config/sunspot.yml
|
203
203
|
- spec/rails_app/db/schema.rb
|
204
|
+
- spec/rails_app/vendor/engines/test_engine/app/models/test_engine/rake_task_auto_load_test_model.rb
|
205
|
+
- spec/rails_app/vendor/engines/test_engine/lib/test_engine.rb
|
206
|
+
- spec/rails_app/vendor/engines/test_engine/lib/test_engine/engine.rb
|
204
207
|
- spec/rake_task_spec.rb
|
205
208
|
- spec/request_lifecycle_spec.rb
|
206
209
|
- spec/schema.rb
|
@@ -216,7 +219,7 @@ homepage: http://github.com/sunspot/sunspot/tree/master/sunspot_rails
|
|
216
219
|
licenses:
|
217
220
|
- MIT
|
218
221
|
metadata: {}
|
219
|
-
post_install_message:
|
222
|
+
post_install_message:
|
220
223
|
rdoc_options:
|
221
224
|
- "--webcvs=http://github.com/outoftime/sunspot/tree/master/%s"
|
222
225
|
- "--title"
|
@@ -236,8 +239,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
239
|
- !ruby/object:Gem::Version
|
237
240
|
version: '0'
|
238
241
|
requirements: []
|
239
|
-
rubygems_version: 3.
|
240
|
-
signing_key:
|
242
|
+
rubygems_version: 3.1.4
|
243
|
+
signing_key:
|
241
244
|
specification_version: 4
|
242
245
|
summary: Rails integration for the Sunspot Solr search library
|
243
246
|
test_files:
|
@@ -267,6 +270,9 @@ test_files:
|
|
267
270
|
- spec/rails_app/config/routes.rb
|
268
271
|
- spec/rails_app/config/sunspot.yml
|
269
272
|
- spec/rails_app/db/schema.rb
|
273
|
+
- spec/rails_app/vendor/engines/test_engine/app/models/test_engine/rake_task_auto_load_test_model.rb
|
274
|
+
- spec/rails_app/vendor/engines/test_engine/lib/test_engine.rb
|
275
|
+
- spec/rails_app/vendor/engines/test_engine/lib/test_engine/engine.rb
|
270
276
|
- spec/rake_task_spec.rb
|
271
277
|
- spec/request_lifecycle_spec.rb
|
272
278
|
- spec/schema.rb
|