This tip aims to define all methods to enchant a model (make it persistant).
Enchanting: Add the needed features like .find, the manager .ogmanager which contains the database connection pool, creates the database and adds a primary key called oid when nothing else is specified.
The first and easiest method:
class User attr_accessor :name, String end
When, and only when, one or more symbols are followed by a Class, the User class is regarded as a Og Model.
All implicit declaration keywords:
class User < Og::Entity end
This class will be enchanted on creation, regardless on what you write in there.
class User include Og::EntityMixin end
This is analog to the subclassing, it will enchant your model as well.
class User is Taggable end
This also makes the User class managed because Taggable depends on a database and sets everything up for you.
The is keyword is provided by Facets and is the same as using include.
Other standard libraries you can include to get the class managed: