README.md in nano-store-0.4.3 vs README.md in nano-store-0.5.0
- old
+ new
@@ -168,9 +168,34 @@
# obtain the bags from document store
bags = store.bags
```
+### Association
+
+Use ```bag``` to declare a Bag that associated with a Model.
+
+````ruby
+
+class User < NanoStore::Model
+ attribute :name
+ attribute :age
+ attribute :created_at
+ bag :cars
+end
+
+class Car < NanoStore::Model
+ attribute :name
+ attribute :age
+end
+
+user = User.new(:name => "Peter", :age => 20, :created_at => Time.now)
+user.cars << Car.new(:name => "Mini", :age => 0)
+user.save
+
+user.cars # => #<NanoStore::Bag:0x7411410>
+````
+
## Performance Tips
NanoStore by defaults saves every object to disk one by one. To speed up inserts and edited objects, increase NSFNanoStore's ```saveInterval``` property.
### Example
\ No newline at end of file