Browse files

backing off on automatically validating/saving deeply nested modified…

… records. the penalty is too big. see the newly failing tests for the tradeoff.
  • Loading branch information...
cainlevy committed Dec 14, 2008
1 parent cfba211 commit 5012f410069ee5c68847f02c8c9954138955723c
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/nested_assignment.rb
@@ -8,7 +8,7 @@ def self.included(base)
alias_method_chain :save, :associated
alias_method_chain :valid?, :associated
- alias_method_chain :changed?, :associated
+# alias_method_chain :changed?, :associated
@@ -83,6 +83,8 @@ def save_with_associated(*args)
# an attribute on a tag but not on the task. Then when we are saving
# the user, we would want to say that the task had changed so we
# could then recurse and discover that the tag had changed.
+ #
+ # Unfortunately, this can also have a 2x performance penalty.
def changed_with_associated?
without_recursion(:save) do
changed_without_associated? or changed_associated

0 comments on commit 5012f41

Please sign in to comment.