Permalink
Browse files

Fix documentation for validates_uniqueness_of to NOT have a :scope ar…

…gument as the prime example. Show scope examples after prime example.
  • Loading branch information...
1 parent a41d334 commit f612069ae157ba4312672d59dd844a01197cac9e @radar radar committed Jan 6, 2011
Showing with 8 additions and 3 deletions.
  1. +8 −3 activerecord/lib/active_record/validations/uniqueness.rb
@@ -85,11 +85,16 @@ module ClassMethods
# 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

0 comments on commit f612069

Please sign in to comment.