Low commit activity in last 3 years
A long-lived project that still receives updates
Bitemporal versioning for sequel, fully tested.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.13.0

Runtime

>= 4.0, < 6.0
 Project Readme

sequel_bitemporal

Build Status

Bitemporal versioning for Sequel.

Dependencies

  • Ruby >= 1.9.2
  • gem "sequel", "~> 3.30.0"

Usage

Declare bitemporality inside your model:

class HotelPriceVersion < Sequel::Model
end

class HotelPrice < Sequel::Model
  plugin :bitemporal, version_class: HotelPriceVersion
end

You can now create a hotel price with bitemporal versions:

price = HotelPrice.new
price.update_attributes price: 18

To show all versions:

price.versions

To show current version:

price.current_version

Look at the specs for more usage patterns.

Thanks

Thanks to Evgeniy L (@fiscal-cliff) for his contributions:

  • skip plugin initialization process if versions table does not exist

Thanks to Ksenia Zalesnaya (@ksenia-zalesnaya) for her contributions:

  • define setter methods for versioned columns

Thanks to Denis Kalesnikov (@DenisKem) for his contributions:

  • add support for composite primary key #8

Thanks to Olle Jonsson (@olleolleolle) for his contributions:

  • update specs to work with RSpec: config.disable_monkey_patching! #10
  • update TravisCI matrix to include more Ruby versions #11
  • README improvements #9 #12

License

sequel_bitemporal is Copyright © 2011 TalentBox SA. It is free software, and may be redistributed under the terms specified in the LICENSE file.