sunspot_rails 2.3.0 → 2.4.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 +4 -4
- data/Appraisals +14 -11
- data/lib/sunspot/rails/searchable.rb +9 -3
- data/lib/sunspot/rails/stub_session_proxy.rb +4 -0
- data/spec/rails_app/app/models/author.rb +0 -2
- data/spec/rails_app/app/models/blog.rb +0 -2
- data/spec/rails_app/app/models/location.rb +0 -1
- data/spec/rails_app/app/models/post.rb +0 -2
- data/spec/rails_app/app/models/post_with_auto.rb +0 -2
- data/spec/rails_app/app/models/post_with_default_scope.rb +0 -2
- data/spec/rails_app/app/models/post_with_only_some_attributes_triggering_reindex.rb +0 -2
- data/spec/rails_app/config/environments/test.rb +3 -0
- data/spec/stub_session_proxy_spec.rb +4 -0
- data/sunspot_rails.gemspec +10 -4
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44a1a366cb8852c32d51937b3c94145cb825a03b978e5ca66ee749d3d909e065
|
4
|
+
data.tar.gz: 0377a545b9d2f0aaa387486e43d90d4ce1f1c37aae3164f5467b0358788f8fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c2a3c9ffc207113b86ab022a50b2128031dcdb3a4caf9ae2d346a78a2541235c55953035d9128a60a4d479a7f380ad09b2123f8c8b50a78e8318af9389bf973
|
7
|
+
data.tar.gz: f417ab24fdd8be1100b2e7f0968e5e7e240e04f4142d3a3a74ae40bfbf3c3983874e6f5ad942a4be908515da6ae02682bf27eaabeed66c549997bf174d68e4d2
|
data/Appraisals
CHANGED
@@ -3,6 +3,7 @@ ruby_version = Gem::Version.new(RUBY_VERSION)
|
|
3
3
|
if ruby_version < Gem::Version.new('2.2.0')
|
4
4
|
['3.0.0', '3.1.0'].each do |rails_version|
|
5
5
|
appraise "rails-#{rails_version}" do
|
6
|
+
gem 'bundler', '>= 1.3.0', '< 2.0'
|
6
7
|
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
7
8
|
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
8
9
|
gem 'rails', "~> #{rails_version}"
|
@@ -15,6 +16,7 @@ end
|
|
15
16
|
|
16
17
|
if ruby_version < Gem::Version.new('2.4.0')
|
17
18
|
appraise 'rails-3.2.0' do
|
19
|
+
gem 'bundler', '>= 1.3.0', '< 2.0'
|
18
20
|
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
19
21
|
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
20
22
|
gem 'rails', '~> 3.2.0'
|
@@ -26,10 +28,10 @@ if ruby_version < Gem::Version.new('2.4.0')
|
|
26
28
|
|
27
29
|
['4.0.0', '4.1.0'].each do |rails_version|
|
28
30
|
appraise "rails-#{rails_version}" do
|
31
|
+
gem 'bundler', '>= 1.3.0', '< 2.0'
|
29
32
|
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
30
33
|
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
31
34
|
gem 'rails', "~> #{rails_version}"
|
32
|
-
gem 'protected_attributes'
|
33
35
|
gem 'progress_bar', '~> 1.0.5', require: false
|
34
36
|
gem 'rspec', '~> 3.4.0'
|
35
37
|
gem 'rspec-rails', '~> 3.4.0'
|
@@ -37,23 +39,24 @@ if ruby_version < Gem::Version.new('2.4.0')
|
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
if ruby_version < Gem::Version.new('2.5.0')
|
43
|
+
appraise 'rails-4.2.0' do
|
44
|
+
gem 'bundler', '>= 1.3.0', '< 2.0'
|
45
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
46
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
47
|
+
gem 'rails', '~> 4.2.0'
|
48
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
49
|
+
gem 'rspec', '~> 3.4.0'
|
50
|
+
gem 'rspec-rails', '~> 3.4.0'
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
54
|
if ruby_version >= Gem::Version.new('2.2.0')
|
51
|
-
['5.0.0', '5.1.0'].each do |rails_version|
|
55
|
+
['5.0.0', '5.1.0', '5.2.0'].each do |rails_version|
|
52
56
|
appraise "rails-#{rails_version}" do
|
53
57
|
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
54
58
|
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
55
59
|
gem 'rails', "~> #{rails_version}"
|
56
|
-
gem 'protected_attributes_continued'
|
57
60
|
gem 'progress_bar', '~> 1.0.5', require: false
|
58
61
|
end
|
59
62
|
end
|
@@ -99,9 +99,15 @@ module Sunspot #:nodoc:
|
|
99
99
|
|
100
100
|
unless options[:auto_remove] == false
|
101
101
|
# after_commit { |searchable| searchable.remove_from_index }, :on => :destroy
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
# Only add the on filter if the callback supports it
|
103
|
+
if Sunspot::Rails.configuration.auto_remove_callback =~ /save|destroy|create/
|
104
|
+
__send__ Sunspot::Rails.configuration.auto_remove_callback,
|
105
|
+
proc { |searchable| searchable.remove_from_index }
|
106
|
+
else
|
107
|
+
__send__ Sunspot::Rails.configuration.auto_remove_callback,
|
108
|
+
proc { |searchable| searchable.remove_from_index },
|
109
|
+
:on => :destroy
|
110
|
+
end
|
105
111
|
end
|
106
112
|
options[:include] = Util::Array(options[:include])
|
107
113
|
|
@@ -3,8 +3,6 @@ class PostWithOnlySomeAttributesTriggeringReindex < ActiveRecord::Base
|
|
3
3
|
'posts'
|
4
4
|
end
|
5
5
|
|
6
|
-
attr_accessible :title, :type, :location_id, :body, :blog
|
7
|
-
|
8
6
|
searchable :only_reindex_attribute_changes_of => [ :title, :body ] do
|
9
7
|
string :title
|
10
8
|
text :body, :more_like_this => true
|
@@ -33,6 +33,9 @@ RailsApp::Application.configure do
|
|
33
33
|
# like if you have constraints or database-specific column types
|
34
34
|
# config.active_record.schema_format = :sql
|
35
35
|
|
36
|
+
# mute Rails 5.2 deprecation warning
|
37
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true if config.active_record.sqlite3
|
38
|
+
|
36
39
|
# Print deprecation notices to the stderr
|
37
40
|
config.active_support.deprecation = :stderr
|
38
41
|
end
|
@@ -118,6 +118,10 @@ describe 'specs with Sunspot stubbed' do
|
|
118
118
|
Sunspot.more_like_this(@post)
|
119
119
|
end
|
120
120
|
|
121
|
+
it 'should not raise error when reindexing scope' do
|
122
|
+
expect{ Post.solr_index }.to_not raise_error
|
123
|
+
end
|
124
|
+
|
121
125
|
describe 'stub search' do
|
122
126
|
before :each do
|
123
127
|
@search = Post.search
|
data/sunspot_rails.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
'Brian Atkinson', 'Tom Coleman', 'Matt Mitchell', 'Nathan Beyer', 'Kieran Topping', 'Nicolas Braem', 'Jeremy Ashkenas',
|
14
14
|
'Dylan Vaughn', 'Brian Durand', 'Sam Granieri', 'Nick Zadrozny', 'Jason Ronallo']
|
15
15
|
s.email = ["mat@patch.com"]
|
16
|
-
s.homepage = 'http://github.com/
|
16
|
+
s.homepage = 'http://github.com/sunspot/sunspot/tree/master/sunspot_rails'
|
17
17
|
s.summary = 'Rails integration for the Sunspot Solr search library'
|
18
18
|
s.license = 'MIT'
|
19
19
|
s.description = <<-TEXT
|
@@ -32,15 +32,21 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
33
33
|
s.require_paths = ["lib"]
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
if RUBY_VERSION < '2.2'
|
36
|
+
s.add_dependency 'rails', '>= 3', '< 5'
|
37
|
+
else
|
38
|
+
s.add_dependency 'rails', '>= 3'
|
39
|
+
end
|
37
40
|
|
41
|
+
s.add_dependency 'sunspot', Sunspot::VERSION
|
42
|
+
|
38
43
|
s.add_development_dependency 'appraisal', '2.2.0'
|
44
|
+
s.add_development_dependency 'bundler', '>= 1.3.0', '< 2.0' if RUBY_VERSION <= '2.0.0'
|
39
45
|
s.add_development_dependency 'nokogiri', '< 1.7' if RUBY_VERSION <= '2.0.0'
|
40
46
|
s.add_development_dependency 'rake', '< 12.3'
|
41
47
|
s.add_development_dependency 'rspec', '~> 3.7'
|
42
48
|
s.add_development_dependency 'rspec-rails', '~> 3.7'
|
43
|
-
s.add_development_dependency 'sqlite3', '~> 1.3'
|
49
|
+
s.add_development_dependency 'sqlite3', '~> 1.3.0'
|
44
50
|
|
45
51
|
s.rdoc_options << '--webcvs=http://github.com/outoftime/sunspot/tree/master/%s' <<
|
46
52
|
'--title' << 'Sunspot-Rails - Rails integration for the Sunspot Solr search library - API Documentation' <<
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -26,7 +26,7 @@ authors:
|
|
26
26
|
autorequire:
|
27
27
|
bindir: bin
|
28
28
|
cert_chain: []
|
29
|
-
date:
|
29
|
+
date: 2019-07-05 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.4.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.4.0
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: appraisal
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,14 +118,14 @@ dependencies:
|
|
118
118
|
requirements:
|
119
119
|
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
121
|
+
version: 1.3.0
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
128
|
+
version: 1.3.0
|
129
129
|
description: |2
|
130
130
|
Sunspot::Rails is an extension to the Sunspot library for Solr search.
|
131
131
|
Sunspot::Rails adds integration between Sunspot and ActiveRecord, including
|
@@ -212,7 +212,7 @@ files:
|
|
212
212
|
- spec/spec_helper.rb
|
213
213
|
- spec/stub_session_proxy_spec.rb
|
214
214
|
- sunspot_rails.gemspec
|
215
|
-
homepage: http://github.com/
|
215
|
+
homepage: http://github.com/sunspot/sunspot/tree/master/sunspot_rails
|
216
216
|
licenses:
|
217
217
|
- MIT
|
218
218
|
metadata: {}
|
@@ -236,8 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
- !ruby/object:Gem::Version
|
237
237
|
version: '0'
|
238
238
|
requirements: []
|
239
|
-
|
240
|
-
rubygems_version: 2.7.6
|
239
|
+
rubygems_version: 3.0.2
|
241
240
|
signing_key:
|
242
241
|
specification_version: 4
|
243
242
|
summary: Rails integration for the Sunspot Solr search library
|