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