Add documentation to validate_absence_of on qualifier

[ci skip]
This commit is contained in:
Mauro George 2015-03-28 11:24:45 -03:00 committed by Elliot Winkler
parent 388af8bfa5
commit eddbf3ea3c
1 changed files with 21 additions and 0 deletions

View File

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