aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations_repair_helper.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-12-28 11:13:35 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-12-28 11:13:35 -0800
commit632df063a33fab68b50ed893630af7f38821878d (patch)
treeef76a8193129d9e51a86226224021ba63fb6d1b7 /activemodel/lib/active_model/validations_repair_helper.rb
parent91e28aae8649c503e81d66ad6829403ccc2c6571 (diff)
parent74098e4cb6de01745db8f1d8d567645553ade7c5 (diff)
downloadrails-632df063a33fab68b50ed893630af7f38821878d.tar.gz
rails-632df063a33fab68b50ed893630af7f38821878d.tar.bz2
rails-632df063a33fab68b50ed893630af7f38821878d.zip
Merge commit 'josevalim/validations'
Diffstat (limited to 'activemodel/lib/active_model/validations_repair_helper.rb')
-rw-r--r--activemodel/lib/active_model/validations_repair_helper.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/activemodel/lib/active_model/validations_repair_helper.rb b/activemodel/lib/active_model/validations_repair_helper.rb
deleted file mode 100644
index 40741e6dbe..0000000000
--- a/activemodel/lib/active_model/validations_repair_helper.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-module ActiveModel
- module ValidationsRepairHelper
- extend ActiveSupport::Concern
-
- module ClassMethods
- def repair_validations(*model_classes)
- setup do
- @_stored_callbacks = {}
- model_classes.each do |k|
- @_stored_callbacks[k] = k._validate_callbacks.dup
- end
- end
- teardown do
- model_classes.each do |k|
- k._validate_callbacks = @_stored_callbacks[k]
- k.__update_callbacks(:validate)
- end
- end
- end
- end
-
- def repair_validations(*model_classes, &block)
- @__stored_callbacks = {}
- model_classes.each do |k|
- @__stored_callbacks[k] = k._validate_callbacks.dup
- end
- return block.call
- ensure
- model_classes.each do |k|
- k._validate_callbacks = @__stored_callbacks[k]
- k.__update_callbacks(:validate)
- end
- end
- end
-end