sunspot_rails 2.3.0 → 2.4.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: c03385c874a558e6fdbf6390e452bfc5c87a09f8a6c3d5efae34854e7fdab3d5
4
- data.tar.gz: 472395a2311af2ef0323a5332c444275876958c4d2f8c6dacd50cee7fef0da56
3
+ metadata.gz: 44a1a366cb8852c32d51937b3c94145cb825a03b978e5ca66ee749d3d909e065
4
+ data.tar.gz: 0377a545b9d2f0aaa387486e43d90d4ce1f1c37aae3164f5467b0358788f8fa9
5
5
  SHA512:
6
- metadata.gz: ccdf1424ba07fa9b7f9e2e6e0f4efc421f4da5aea49c3be1359616bb8727256fd72e7895ef0e294878d2e9f2c440661fbe97507b0219409eedb949c45cd2bf9d
7
- data.tar.gz: 84c1b362c773e4c4a47a4e662ab0c9ac1bc8afdd018da8c8c88d9f88092846a44e86755c93692e9fbbed550947c54c23545466092cc9cb50f858f650d784fe14
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
- appraise 'rails-4.2.0' do
41
- gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
42
- gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
43
- gem 'rails', '~> 4.2.0'
44
- gem 'protected_attributes'
45
- gem 'progress_bar', '~> 1.0.5', require: false
46
- gem 'rspec', '~> 3.4.0'
47
- gem 'rspec-rails', '~> 3.4.0'
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
- __send__ Sunspot::Rails.configuration.auto_remove_callback,
103
- proc { |searchable| searchable.remove_from_index },
104
- :on => :destroy
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
 
@@ -44,6 +44,10 @@ module Sunspot
44
44
  def optimize
45
45
  end
46
46
 
47
+ def config
48
+ Sunspot::Configuration.build
49
+ end
50
+
47
51
  def dirty?
48
52
  false
49
53
  end
@@ -2,8 +2,6 @@ class Author < ActiveRecord::Base
2
2
  self.table_name = :writers
3
3
  self.primary_key = :writer_id
4
4
 
5
- attr_accessible :name
6
-
7
5
  searchable do
8
6
  string :name
9
7
  end
@@ -2,8 +2,6 @@ class Blog < ActiveRecord::Base
2
2
  has_many :posts
3
3
  has_many :comments, :through => :posts
4
4
 
5
- attr_accessible :name, :subdomain
6
-
7
5
  searchable :include => { :posts => :author } do
8
6
  string :subdomain
9
7
  text :name
@@ -1,3 +1,2 @@
1
1
  class Location < ActiveRecord::Base
2
- attr_accessible :lat, :lng
3
2
  end
@@ -3,8 +3,6 @@ class Post < ActiveRecord::Base
3
3
  belongs_to :author
4
4
  has_many :comments
5
5
 
6
- attr_accessible :title, :type, :location_id, :body, :blog
7
-
8
6
  searchable :auto_index => false, :auto_remove => false do
9
7
  string :title
10
8
  text :body, :more_like_this => true
@@ -3,8 +3,6 @@ class PostWithAuto < ActiveRecord::Base
3
3
  'posts'
4
4
  end
5
5
 
6
- attr_accessible :title, :type, :location_id, :body, :blog
7
-
8
6
  searchable :ignore_attribute_changes_of => [ :updated_at ] do
9
7
  string :title
10
8
  text :body, :more_like_this => true
@@ -3,8 +3,6 @@ class PostWithDefaultScope < ActiveRecord::Base
3
3
  'posts'
4
4
  end
5
5
 
6
- attr_accessible :title, :type, :location_id, :body, :blog
7
-
8
6
  def self.default_scope
9
7
  order(:title)
10
8
  end
@@ -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
@@ -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/outoftime/sunspot/tree/master/sunspot_rails'
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
- s.add_dependency 'rails', '>= 3'
36
- s.add_dependency 'sunspot', Sunspot::VERSION
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.3.0
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: 2018-04-08 00:00:00.000000000 Z
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.3.0
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.3.0
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: '1.3'
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: '1.3'
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/outoftime/sunspot/tree/master/sunspot_rails
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
- rubyforge_project: sunspot
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