Add documentation to validates_presence_of on qualifier

[ci skip]
This commit is contained in:
Mauro George 2014-12-04 19:49:50 -02:00 committed by Elliot Winkler
parent cf76d747ee
commit 51283c0450
1 changed files with 21 additions and 0 deletions

View File

@ -57,6 +57,27 @@ module Shoulda
#
# #### Qualifiers
#
# ##### on
#
# Use `on` if your validation applies only under a certain context.
#
# class Robot
# include ActiveModel::Model
# attr_accessor :arms
#
# validates_presence_of :arms, on: :create
# end
#
# # RSpec
# describe Robot do
# it { should validate_presence_of(:arms).on(:create) }
# end
#
# # Test::Unit
# class RobotTest < ActiveSupport::TestCase
# should validate_presence_of(:arms).on(:create)
# end
#
# ##### with_message
#
# Use `with_message` if you are using a custom validation message.