Refactoring tests and Validation callbacks
This commit is contained in:
parent
ea4325f5bf
commit
3579e0e334
47 changed files with 142 additions and 142 deletions
22
spec/fixtures/models/user.rb
vendored
Normal file
22
spec/fixtures/models/user.rb
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
class User < CouchRest::Model::Base
|
||||
# Set the default database to use
|
||||
use_database DB
|
||||
property :name, :accessible => true
|
||||
property :admin # this will be automatically protected
|
||||
end
|
||||
|
||||
class SpecialUser < CouchRest::Model::Base
|
||||
# Set the default database to use
|
||||
use_database DB
|
||||
property :name # this will not be protected
|
||||
property :admin, :protected => true
|
||||
end
|
||||
|
||||
# There are two modes of protection
|
||||
# 1) Declare accessible poperties, assume all the rest are protected
|
||||
# property :name, :accessible => true
|
||||
# property :admin # this will be automatically protected
|
||||
#
|
||||
# 2) Declare protected properties, assume all the rest are accessible
|
||||
# property :name # this will not be protected
|
||||
# property :admin, :protected => true
|
Loading…
Add table
Add a link
Reference in a new issue