Permalink
Browse files

Not running .callback_has_visible_attributes? on validation adapters …

…that alters tag attributes. We need to know about all the validations before rendering the form for these types of adapters, because the form itself gets altered.
  • Loading branch information...
1 parent a0d383c commit 9dba554dd3ee7261bc8bed42e258ec075df810fd @augustl committed May 3, 2009
Showing with 1 addition and 2 deletions.
  1. +1 −1 lib/live_validations/adapter_base.rb
  2. +0 −1 test/validatious_test.rb
@@ -15,7 +15,7 @@ def initialize(active_record_instance)
def run_validations
active_record_instance.validation_callbacks.each do |callback|
- next unless callback_has_visible_attributes?(callback)
+ next if !alters_tag_attributes? && !callback_has_visible_attributes?(callback)
method = callback.options[:validation_method]
validation_hook = self.class.validation_hooks[method]
@@ -23,7 +23,6 @@ def test_confirmation
def assert_expected_attributes_data(expected_attributes_data)
validator = LiveValidations::Adapters::Validatious.new(Post.new)
- validator.expects(:callback_has_visible_attributes?).returns(true)
validator.run_validations
assert_equal expected_attributes_data, validator[:tag_attributes]

0 comments on commit 9dba554

Please sign in to comment.