Parent

Class/Module Index [+]

Quicksearch

Shoulda::Matchers::ActiveModel::ValidateConfirmationOfMatcher

@private

Attributes

attribute[R]
confirmation_attribute[R]

Public Class Methods

new(attribute) click to toggle source
# File lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb, line 64
def initialize(attribute)
  super(attribute)
  @confirmation_attribute = "#{attribute}_confirmation"
end

Public Instance Methods

description() click to toggle source
# File lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb, line 74
def description
  "require #{@confirmation_attribute} to match #{@attribute}"
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb, line 78
def matches?(subject)
  super(subject)
  @message ||= :confirmation

  disallows_different_value &&
    allows_same_value &&
    allows_missing_confirmation
end
with_message(message) click to toggle source
# File lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb, line 69
def with_message(message)
  @message = message if message
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.