I have a table like this: (id, name, version, text). (name, version) is unique key, how can i make a rule to validate this.
May be you can add this rules onto your code
rules
return array( array('name', 'unique', 'className'=>'MyModel', 'attributeName'=>'myName'), array('version', 'unique', 'className'=>'MyModel', 'attributeName'=>'myVersion') );