Permalink
Browse files

Give extracted options back to args in AMo callbacks. Fixes two faili…

…ng tests in AR.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 9269e55 commit 8158afa47ebe8c2f33cce72b71cb82cb97af0431 @rohit rohit committed with spastorino Aug 4, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/validations/callbacks.rb
@@ -33,7 +33,7 @@ def before_validation(*args, &block)
options[:if] = Array.wrap(options[:if])
options[:if] << "self.validation_context == :#{options[:on]}"
end
- set_callback(:validation, :before, *args, &block)
+ set_callback(:validation, :before, *(args << options), &block)
end
def after_validation(*args, &block)

0 comments on commit 8158afa

Please sign in to comment.