aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-09-08 10:22:45 -0500
committerJoshua Peek <josh@joshpeek.com>2009-09-08 10:26:39 -0500
commit2ea1d684d93bd59887a9fd12e647941f0d1f4868 (patch)
tree808bb2e7a081c5010df134269e765d3b4c0a12b9 /activemodel
parent4f37b97033f596ec2c95eb53e9964e051c224981 (diff)
downloadrails-2ea1d684d93bd59887a9fd12e647941f0d1f4868.tar.gz
rails-2ea1d684d93bd59887a9fd12e647941f0d1f4868.tar.bz2
rails-2ea1d684d93bd59887a9fd12e647941f0d1f4868.zip
Refactor new callbacks and AR implementation.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/validations.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 72898726d1..edeb508a08 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -9,7 +9,7 @@ module ActiveModel
include ActiveSupport::NewCallbacks
included do
- define_callbacks :validate
+ define_callbacks :validate, :scope => :name
end
module ClassMethods
@@ -79,7 +79,7 @@ module ActiveModel
options[:if] = Array(options[:if])
options[:if] << "@_on_validate == :#{options[:on]}"
end
- set_callback(:validate, :before, *args, &block)
+ set_callback(:validate, *args, &block)
end
end