Commit 1aaa6fa716755f9e02c693372cdf5a62eef638ec
1 parent
f4be5188
Exists in
master
and in
29 other branches
[pluginize-solr] Moving handle_asynchronously solr save
Showing
8 changed files
with
9 additions
and
10 deletions
Show diff stats
app/models/article.rb
app/models/category.rb
app/models/product.rb
app/models/profile.rb
plugins/solr/lib/ext/article.rb
| 1 | 1 | require_dependency 'article' |
| 2 | 2 | |
| 3 | 3 | class Article |
| 4 | - def solr_plugin_comments_updated | |
| 5 | - solr_save | |
| 6 | - end | |
| 4 | + | |
| 5 | + handle_asynchronously :solr_save | |
| 7 | 6 | |
| 8 | 7 | acts_as_faceted :fields => { |
| 9 | 8 | :solr_plugin_f_type => {:label => _('Type'), :proc => proc{|klass| solr_plugin_f_type_proc(klass)}}, |
| ... | ... | @@ -35,6 +34,10 @@ class Article |
| 35 | 34 | :boost => proc { |a| 10 if a.profile && a.profile.enabled }, |
| 36 | 35 | :if => proc{ |a| ! ['RssFeed'].include?(a.class.name) } |
| 37 | 36 | |
| 37 | + def solr_plugin_comments_updated | |
| 38 | + solr_save | |
| 39 | + end | |
| 40 | + | |
| 38 | 41 | private |
| 39 | 42 | |
| 40 | 43 | def self.solr_plugin_f_type_proc(klass) | ... | ... |
plugins/solr/lib/ext/category.rb
plugins/solr/lib/ext/product.rb
plugins/solr/lib/ext/profile.rb
| ... | ... | @@ -2,6 +2,7 @@ require_dependency 'profile' |
| 2 | 2 | |
| 3 | 3 | class Profile |
| 4 | 4 | after_save_reindex [:articles], :with => :delayed_job |
| 5 | + handle_asynchronously :solr_save | |
| 5 | 6 | |
| 6 | 7 | acts_as_faceted :fields => { |
| 7 | 8 | :solr_plugin_f_enabled => {:label => _('Situation'), :type_if => proc { |klass| klass.kind_of?(Enterprise) }, | ... | ... |