fixing issue with elasticsearch option false in dev

This commit is contained in:
Shiho Takagi committed 2015-02-02 18:40:24 +11:00
1 parent ca47127197
commit 656b0e44d8
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
class AlternateName < ActiveRecord::Base
after_commit { |an| an.crop.__elasticsearch__.index_document if an.crop }
after_commit { |an| an.crop.__elasticsearch__.index_document if an.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
belongs_to :crop
belongs_to :creator, :class_name => 'Member'
end
+1 -1
View File
@@ -85,7 +85,7 @@ class Crop < ActiveRecord::Base
end
def update_index(name_obj)
__elasticsearch__.index_document
__elasticsearch__.index_document if ENV['GROWSTUFF_ELASTICSEARCH'] == "true"
end
####################################
+1 -1
View File
@@ -1,5 +1,5 @@
class ScientificName < ActiveRecord::Base
after_commit { |sn| sn.crop.__elasticsearch__.index_document if sn.crop }
after_commit { |sn| sn.crop.__elasticsearch__.index_document if sn.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
belongs_to :crop
belongs_to :creator, :class_name => 'Member'
end