README.md in gdatastore_mapper-0.1.6 vs README.md in gdatastore_mapper-0.1.7

- old
+ new

@@ -14,10 +14,11 @@ - [Scoping Methods](#scoping-methods) - [Timestamp](#timestamp) - [Associations](#associations) - [One to Many](#one-to-many) - [Callbacks](#callbacks) +- [Validations](#validations) - [Contact](#contact) - [Development](#development) ## Demo @@ -225,9 +226,24 @@ something that you want end end ``` + +## Validations + +```ruby +class Author + include GdatastoreMapper::Base + + attr_accessor :email + + validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i } + validates :email, length: { in: 3..20 } + validates_uniqueness_of :email +end +``` + ## Contact Please shoot me an e-mail if you find any issues, ideas and comments. shinya.kitamura.14@gmail.com Thanks!