my take on a timestamping plugin for sequel
The existing implementations I saw checked for the attributes every time a record was saved. This version checks when plugged in.
Additionally, the updated_by attribute is explicitly settable in at least one other implementation. It's not in this one (by design).
Run the following if you haven't already:
$ gem sources -a http://gems.github.com
Install the gem(s):
$ sudo gem install -r sbfaulkner-sequel_timestamped
require 'rubygems' require 'sequel' class Post < Sequel::Model is :timestamped, :using => :utc end
- add support for utc (or localtime) by passing option :using => :utc (or :localtime)
- maybe rename sequel_audited
- add created_by and updated_by support?
- publish in sequel www/pages/plugins
Author: S. Brent Faulkner email@example.com License: Copyright © 2009 unwwwired.net, released under the MIT license