1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix documentation for validates_uniqueness_of to NOT have a :scope argument as the prime example. Show scope examples after prime example.

This commit is contained in:
Ryan Bigg 2011-01-06 20:06:52 +10:00
parent a41d33431f
commit f612069ae1

View file

@ -85,11 +85,16 @@ module ActiveRecord
# can be named "davidhh".
#
# class Person < ActiveRecord::Base
# validates_uniqueness_of :user_name, :scope => :account_id
# validates_uniqueness_of :user_name
# end
#
# It can also validate whether the value of the specified attributes are unique based on multiple
# scope parameters. For example, making sure that a teacher can only be on the schedule once
# It can also validate whether the value of the specified attributes are unique based on a scope parameter:
#
# class Person < ActiveRecord::Base
# validates_uniqueness_of :user_name, :scope => :account_id
# end
#
# Or even multiple scope parameters. For example, making sure that a teacher can only be on the schedule once
# per semester for a particular class.
#
# class TeacherSchedule < ActiveRecord::Base