Rails plugin for saving additional data for model.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
README.md
Rakefile
deposit.gemspec
makefile

README.md

Deposit

Rails plugin for saving additional data for model.

Requirements

This gem is for Rails 3 with ActiveRecord and later versions only.

Install

Add this to your Gemfile:

gem 'deposit'

run bundle install,

And then rails g deposit_migration, It will create table deposits for you.

Usage

Simply add as_depositable to your model:

class Product < ActiveRecord::Base
  as_depositable
end

you can load and save deposit like this:

p = Product.last
p.save_deposit :transition, {id: 123, date: Time.now}
p.load_deposit :transition # => return saved data

Testing

First bundle install, then make test.