From 79e5244e96e6c94857eda2552067ffd4f8ecef25 Mon Sep 17 00:00:00 2001 From: James Dabbs Date: Tue, 12 Mar 2013 22:15:54 -0400 Subject: [PATCH] Fix regression in model class checking --- lib/cave/model_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cave/model_form.rb b/lib/cave/model_form.rb index 35f5720..1c272a2 100644 --- a/lib/cave/model_form.rb +++ b/lib/cave/model_form.rb @@ -30,8 +30,8 @@ def persist! private #----------- def check_instance_model + model = self.class.model if @instance - model = self.class.model # Pry alters models in such a way that the first check may fail when it # shouldn't. The second should still be fairly safe. unless @instance.is_a?(model) || @instance.class.name == model.name