From 88ba47ae6d420c15613aa0faf1025c89c4286b47 Mon Sep 17 00:00:00 2001 From: Mal Curtis Date: Tue, 12 Feb 2013 06:38:13 +1300 Subject: [PATCH 1/2] Ensure indices are cleared after touch --- lib/kasket/write_mixin.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kasket/write_mixin.rb b/lib/kasket/write_mixin.rb index 1886cb1..2ecaba2 100644 --- a/lib/kasket/write_mixin.rb +++ b/lib/kasket/write_mixin.rb @@ -78,6 +78,7 @@ def self.included(model_class) end model_class.after_save :clear_kasket_indices + model_class.after_touch :clear_kasket_indices model_class.after_destroy :clear_kasket_indices model_class.alias_method_chain :reload, :kasket_clearing From be29a7952b638067c9570ed13b9a2b3cc245b9d8 Mon Sep 17 00:00:00 2001 From: Mal Curtis Date: Wed, 17 Jul 2013 18:04:47 +1200 Subject: [PATCH 2/2] Don't call after_touch if the method doesn't exist --- lib/kasket/write_mixin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kasket/write_mixin.rb b/lib/kasket/write_mixin.rb index 2ecaba2..9000980 100644 --- a/lib/kasket/write_mixin.rb +++ b/lib/kasket/write_mixin.rb @@ -78,7 +78,7 @@ def self.included(model_class) end model_class.after_save :clear_kasket_indices - model_class.after_touch :clear_kasket_indices + model_class.after_touch :clear_kasket_indices if model_class.respond_to?(:after_touch) model_class.after_destroy :clear_kasket_indices model_class.alias_method_chain :reload, :kasket_clearing