Adding uniqueness validation support out of the box
This commit is contained in:
parent
b81d37fc02
commit
08390e6709
5 changed files with 144 additions and 2 deletions
8
spec/fixtures/base.rb
vendored
8
spec/fixtures/base.rb
vendored
|
@ -114,4 +114,12 @@ class WithAfterInitializeMethod < CouchRest::Model::Base
|
|||
|
||||
end
|
||||
|
||||
class WithUniqueValidation < CouchRest::Model::Base
|
||||
use_database DB
|
||||
|
||||
property :title
|
||||
|
||||
validates_uniqueness_of :title
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue