Carles Jove i Buxeda Sat Sep 08 15:16:06 -0400 2012

Subject: Validate uniqueness of two columns?

Hello,
I have no problem validating the uniqueness of a single column, but is it possible to validate the uniqueness of two or more columns?

For example, if we have a record with 'title'='Hello' and 'content'='World':
- this should be valid: 'title'='Hello', 'content'='Devil'
- but this should not: 'title'='Hello' , 'content'='World'

At the wiki there's this example which looks like is meant for that, but it doesn't seem to work:
array(array('blah','bleh'), 'message' => 'blah and bleh!')

Thank you.


Carles Jove i Buxeda Sat Sep 08 15:31:37 -0400 2012

Sorry guys, I should have double checked before posting this issue.
The example provided in the wiki is correct (silly me!). The only thing you need to take into account is that the error message will be returned only in the errors->full_messages() array.

Well, since I cannot remove this entry, I hope at least it'll help someone.

(1-1/1)