Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 9dba554dd3ee7261bc8bed42e258ec075df810fd 1 parent a0d383c
@augustl authored
View
2  lib/live_validations/adapter_base.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]
View
1  test/validatious_test.rb
@@ -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]
Please sign in to comment.
Something went wrong with that request. Please try again.