Changeset [c1461fbf6cba91021aa74d4511924b0bc7fa4580] by Lin Jen-Shin

April 22nd, 2014 @ 10:40 AM

Add sequel support.

I am trying to migrate some activerecord code to sequel, and this makes
aasm work for sequel out of the box. This is not yet feature complete
as for activerecord, missing some scope related features. However this
could be a start, and to be honest, since we're not using them, this is
far good enough for us.

I have tried my best to make this aligned with activerecord and mongoid,
and I've overridden aasm_read_state for sequel, because there's no
new_record? but only new? in sequel, and there's no blank?, either. (which I believe is provided in activesupport, which sequel
does not depend on, and I don't want to force people to depend on that.)

Thanks for considering.
https://github.com/aasm/aasm/commit/c1461fbf6cba91021aa74d4511924b0...

Committed by Lin Jen-Shin

  • A lib/aasm/persistence/sequel_persistence.rb
  • A spec/unit/persistence/sequel_persistence_spec.rb
  • M lib/aasm/persistence.rb
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Library for adding state machines to Ruby classes. Includes persistence layers for things like ActiveRecord. Formerly known as acts_as_state_machine.