MongoidAccountify

MongoidAccountify adds a relation to models to a Account model and sets it on model initialization.

Install

 gem 'mongoid_accountify'

Usage

 # Default config
 Mongoid::Accountify.configure do |c|
   c. = :current_account
   c. = :account
   c. = :account
 end

 # Example model
 class Person
   include Mongoid::Document
   include Mongoid::Accountify
 end

 # Build instance
 p = Person.new

 # Account instance
 p.
 # => <Account _id: 50470dce6f51b7c68e000009>

Credits

Copyright (c) 2012 Mathias Schneider http://www.codecrafts.de