Smart Phone Tools
About ruby on rails, hackintosh, iphone3g and etc.
Wednesday, February 4, 2009
Rails Validate More than 1 Primary Key
In Ruby on Rails, you can specify your model class to validate uniqueness of multiple columns (multiple primary key). Here is the command:
validates_uniqueness of :email, :scope => :name
if you want to validate uniqueness of a triplet or more
validates_uniqueness of :first_attr, :scope => [ :second_attr,
:third_attr ... ]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2010
(3)
►
February
(1)
►
January
(2)
▼
2009
(45)
►
December
(6)
►
November
(2)
►
October
(4)
►
September
(1)
►
August
(1)
►
May
(4)
►
April
(4)
►
March
(2)
▼
February
(9)
Uninstall SleepWatcher
SQL SUM() in Rails
Hackintosh X61 updated to 10.5.6
Install github on Mac OSX
Open Flash Chart
Core of Dieter Rams' 10 principles for good design
Changes in production database
Rails Validate More than 1 Primary Key
Connecting Rails to MS SQL Server 2000
►
January
(12)
►
2008
(6)
►
October
(6)
No comments:
Post a Comment