Project

deposit

0.0
No commit activity in last 3 years
No release in over 3 years
Rails plugin for saving additional data for model.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.2.8
>= 0
~> 0.3.7
>= 0
~> 2.6

Runtime

~> 3.0
 Project Readme

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.