Skip to content

umbrellio/sequel_bitemporal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

182 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 get 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

License

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

About

Bitemporal versioning for sequel.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%