search for: eachvalid

Displaying 2 results from an estimated 2 matches for "eachvalid".

Did you mean: chvalid
2011 Jan 02
0
"Confirmation" succeeds when the *_confirmation attribute was neglected from the Model.
..., :password_confirmation validates(:password, :confirmation => true, :presence => true) end activemodel/lib/active_model/validations/confirmation.rb: 3 # == Active Model Confirmation Validator 4 module Validations 5 class ConfirmationValidator < EachValidator 6 def validate_each(record, attribute, value) 7 if (confirmed = record.send("#{attribute}_confirmation")) && (value != confirmed) 8 record.errors.add(attribute, :confirmation, options) 9 end 10 end </pre> At line 7, sin...
2013 Nov 14
6
validates :boolean_field, presence: true misconceptions
Last night a friend of mine started ranting about validates_presence_of :boolean_field returning not valid when the boolean field is false. I checked the rails issues and this seems to be a pretty common concern about the naming of ''presence'' . Instead of changing the behaviour of the presence validator, I was wondering if maybe the answer to avoid such misconceptions could be