aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-23 13:30:58 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-23 13:30:58 +0100
commit74098e4cb6de01745db8f1d8d567645553ade7c5 (patch)
tree61998222e5d362991d50fdb68153414848410ae2 /activemodel/lib
parente31077c9aaec05bdf5ea0386eb42fcc039d86a0a (diff)
downloadrails-74098e4cb6de01745db8f1d8d567645553ade7c5.tar.gz
rails-74098e4cb6de01745db8f1d8d567645553ade7c5.tar.bz2
rails-74098e4cb6de01745db8f1d8d567645553ade7c5.zip
No need to use ValidationsRepairHelper hack on ActiveModel anymore, Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model.rb1
-rw-r--r--activemodel/lib/active_model/validations_repair_helper.rb35
2 files changed, 0 insertions, 36 deletions
diff --git a/activemodel/lib/active_model.rb b/activemodel/lib/active_model.rb
index abb04cd624..ee83e3eddd 100644
--- a/activemodel/lib/active_model.rb
+++ b/activemodel/lib/active_model.rb
@@ -43,7 +43,6 @@ module ActiveModel
autoload :StateMachine
autoload :Translation
autoload :Validations
- autoload :ValidationsRepairHelper
autoload :Validator
autoload :EachValidator, 'active_model/validator'
autoload :BlockValidator, 'active_model/validator'
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