Parent

Class/Module Index [+]

Quicksearch

Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher

@private

Public Instance Methods

description() click to toggle source
# File lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb, line 109
def description
  "require #{@attribute} to be set"
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb, line 98
def matches?(subject)
  super(subject)
  @expected_message ||= :blank

  if secure_password_being_validated?
    disallows_and_double_checks_value_of!(blank_value, @expected_message)
  else
    disallows_value_of(blank_value, @expected_message)
  end
end
with_message(message) click to toggle source
# File lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb, line 93
def with_message(message)
  @expected_message = message if message
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.