Module: Sequel::Plugins::CortexReaverValidationHelpers::InstanceMethods

Defined in:
lib/cortex_reaver/support/cortex_reaver_validation_helpers.rb

Instance Method Summary collapse

Instance Method Details

#validates_confirmation(atts, opts = {}) ⇒ Object

Checks to ensure att and att_confirmation are the same.



7
8
9
# File 'lib/cortex_reaver/support/cortex_reaver_validation_helpers.rb', line 7

def validates_confirmation(atts, opts={})
  validatable_attributes(atts, opts) { |a,v,m| (m || "does not match confirmation") unless v == self.send(a.to_s + '_confirmation') }
end