diff --git a/app/models/article.rb b/app/models/article.rb index 950091b..0c6c2bd 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -648,8 +648,6 @@ class Article < ActiveRecord::Base Event delegate :region, :region_id, :environment, :environment_id, :to => :profile, :allow_nil => true - public - handle_asynchronously :solr_save private diff --git a/app/models/category.rb b/app/models/category.rb index 61a8d6f..e523714 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -90,6 +90,4 @@ class Category < ActiveRecord::Base self.children.find(:all, :conditions => {:display_in_menu => true}).empty? end - handle_asynchronously :solr_save - end diff --git a/app/models/product.rb b/app/models/product.rb index fda0c23..93c4418 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -212,6 +212,5 @@ class Product < ActiveRecord::Base end delegate :enabled, :region, :region_id, :environment, :environment_id, :to => :enterprise - handle_asynchronously :solr_save end diff --git a/app/models/profile.rb b/app/models/profile.rb index 3066f6a..b1266f3 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -874,8 +874,6 @@ private :generate_url, :url_options self.active_fields end - handle_asynchronously :solr_save - def control_panel_settings_button {:title => _('Profile Info and settings'), :icon => 'edit-profile'} end diff --git a/plugins/solr/lib/ext/article.rb b/plugins/solr/lib/ext/article.rb index e87623d..c115a39 100644 --- a/plugins/solr/lib/ext/article.rb +++ b/plugins/solr/lib/ext/article.rb @@ -1,9 +1,8 @@ require_dependency 'article' class Article - def solr_plugin_comments_updated - solr_save - end + + handle_asynchronously :solr_save acts_as_faceted :fields => { :solr_plugin_f_type => {:label => _('Type'), :proc => proc{|klass| solr_plugin_f_type_proc(klass)}}, @@ -35,6 +34,10 @@ class Article :boost => proc { |a| 10 if a.profile && a.profile.enabled }, :if => proc{ |a| ! ['RssFeed'].include?(a.class.name) } + def solr_plugin_comments_updated + solr_save + end + private def self.solr_plugin_f_type_proc(klass) diff --git a/plugins/solr/lib/ext/category.rb b/plugins/solr/lib/ext/category.rb index dbf240d..8cc54ee 100644 --- a/plugins/solr/lib/ext/category.rb +++ b/plugins/solr/lib/ext/category.rb @@ -2,6 +2,7 @@ require_dependency 'category' class Category after_save_reindex [:articles, :profiles], :with => :delayed_job + handle_asynchronously :solr_save acts_as_searchable :fields => [ # searched fields diff --git a/plugins/solr/lib/ext/product.rb b/plugins/solr/lib/ext/product.rb index c271d8e..f373b19 100644 --- a/plugins/solr/lib/ext/product.rb +++ b/plugins/solr/lib/ext/product.rb @@ -2,6 +2,7 @@ require_dependency 'product' class Product after_save_reindex [:enterprise], :with => :delayed_job + handle_asynchronously :solr_save acts_as_faceted :fields => { :solr_plugin_f_category => {:label => _('Related products')}, diff --git a/plugins/solr/lib/ext/profile.rb b/plugins/solr/lib/ext/profile.rb index 2b62faa..8ce25f6 100644 --- a/plugins/solr/lib/ext/profile.rb +++ b/plugins/solr/lib/ext/profile.rb @@ -2,6 +2,7 @@ require_dependency 'profile' class Profile after_save_reindex [:articles], :with => :delayed_job + handle_asynchronously :solr_save acts_as_faceted :fields => { :solr_plugin_f_enabled => {:label => _('Situation'), :type_if => proc { |klass| klass.kind_of?(Enterprise) }, -- libgit2 0.21.2