Commit 94d901dca02cb99be7a0523dc4a97b6600afb1d8

Authored by Braulio Bhavamitra
1 parent ec7c804d

Fix solr with delayed job

app/models/article.rb
@@ -642,6 +642,7 @@ class Article < ActiveRecord::Base @@ -642,6 +642,7 @@ class Article < ActiveRecord::Base
642 :facets => facets_option_for_solr, 642 :facets => facets_option_for_solr,
643 :boost => proc {|a| 10 if a.profile.enabled}, 643 :boost => proc {|a| 10 if a.profile.enabled},
644 :if => proc{|a| ! ['RssFeed'].include?(a.class.name)} 644 :if => proc{|a| ! ['RssFeed'].include?(a.class.name)}
  645 + handle_asynchronously :solr_save
645 646
646 private 647 private
647 648
app/models/product.rb
@@ -198,5 +198,6 @@ class Product < ActiveRecord::Base @@ -198,5 +198,6 @@ class Product < ActiveRecord::Base
198 :include => [:enterprise, :qualifiers, :certifiers, :product_category], 198 :include => [:enterprise, :qualifiers, :certifiers, :product_category],
199 :boost => proc {|p| 10 if p.enterprise.enabled}, 199 :boost => proc {|p| 10 if p.enterprise.enabled},
200 :facets => facets.keys 200 :facets => facets.keys
  201 + handle_asynchronously :solr_save
201 202
202 end 203 end
app/models/profile.rb
@@ -864,6 +864,7 @@ private :generate_url, :url_options @@ -864,6 +864,7 @@ private :generate_url, :url_options
864 :extra_data_for_index, {:name_sort => {:type => :string}} ] + facets.keys.map{|i| {i => :facet}}, 864 :extra_data_for_index, {:name_sort => {:type => :string}} ] + facets.keys.map{|i| {i => :facet}},
865 :boost => proc {|p| 10 if p.enabled}, 865 :boost => proc {|p| 10 if p.enabled},
866 :facets => facets.keys 866 :facets => facets.keys
  867 + handle_asynchronously :solr_save
867 868
868 def control_panel_settings_button 869 def control_panel_settings_button
869 {:title => _('Profile Info and settings'), :icon => 'edit-profile'} 870 {:title => _('Profile Info and settings'), :icon => 'edit-profile'}
lib/acts_as_searchable.rb
@@ -14,8 +14,6 @@ module ActsAsSearchable @@ -14,8 +14,6 @@ module ActsAsSearchable
14 acts_as_solr options 14 acts_as_solr options
15 extend FindByContents 15 extend FindByContents
16 send :include, InstanceMethods 16 send :include, InstanceMethods
17 -  
18 - handle_asynchronously :solr_save  
19 end 17 end
20 18
21 module InstanceMethods 19 module InstanceMethods