README.md in gdatastore_mapper-0.1.4 vs README.md in gdatastore_mapper-0.1.5

- old
+ new

@@ -1,6 +1,7 @@ # GdatastoreMapper +[![CircleCI](https://circleci.com/gh/shinyaK14/gdatastore_mapper/tree/master.svg?style=svg)](https://circleci.com/gh/shinyaK14/gdatastore_mapper/tree/master) [![Gem Version](https://badge.fury.io/rb/gdatastore_mapper.svg)](https://badge.fury.io/rb/gdatastore_mapper) GdatastoreMapper is a mapper framework for Google Cloud Datastore in Ruby / Ruby on Rails. Once you install GdatastoreMapper you can use Google Cloud Datastore like ActiveRecord. ## Table of Contents @@ -12,10 +13,12 @@ - [Persistence Methods](#persistence-methods) - [Scoping Methods](#scoping-methods) - [Timestamp](#timestamp) - [Associations](#associations) - [One to Many](#one-to-many) +- [Callbacks](#callbacks) +- [Contact](#contact) - [Development](#development) ## Demo Here is [demo](https://gdatastore-mapper-sample.appspot.com/). The demo works with Google Cloud Datastore. @@ -150,10 +153,11 @@ All records have created_at and updated_at. They will be updated automatically. ## Associations ### One to Many +Associations can be set the same as Active Record. example of one to many relationship ```ruby class Book @@ -194,9 +198,30 @@ ``` ``` harry_poter.author => [#<Author:0x00 @name="J. K. Rowling" .... ] ``` + +## Callbacks + +```ruby +class Book + include GdatastoreMapper::Base + + before_save :something_before_save + + private + def something_before_save + something that you want + end + +end +``` + +## Contact + +Please shoot me an e-mail if you find any issues, ideas and comments. shinya.kitamura.14@gmail.com +Thanks! ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.