No commit activity in last 3 years
No release in over 3 years
Persistence adapter to use AASM with Ohm
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

AasmOhmPersistence

Use AASM with Ohm

Installation

Add this line to your application's Gemfile:

gem 'aasm_ohm_persistence'

And then execute:

$ bundle

Or install it yourself as:

$ gem install aasm_ohm_persistence

Usage

So far this require ohm-contrib to work

To enable AASM for Ohm:

class MyRedisModal < Ohm::Model
  include AASM
  include AASM::Persistence::OhmPersistence

  aasm do
    # Your aasm logic
  end
end

Notice

Unlike active record which use instance method of class to create callback, ohm-contrib use class method to create callbacks.

Since OhmPersistence will declare before_create inside the modal, if you wish to include your own logic to the before_create callback, you need to write it like that:

def before_create
  super
  # your own code
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request