public
Description: Sequel Model plugin to implicitly set created_at and updated_at
Clone URL: git://github.com/bricooke/sequel_timestamped.git
Search Repo:
name age message
folder .gitignore Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
folder CHANGELOG Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
folder COPYING Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
folder README Thu Apr 10 09:49:25 -0700 2008 Update readme with example [bricooke]
folder Rakefile Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
folder lib/ Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
folder spec/ Tue Mar 11 23:21:45 -0700 2008 Initial version [bricooke]
README
If your model is :timestamped, it will automatically set the
:created_at and :updated_at columns if they exist

With a migration like:

class MessageMigration < Sequel::Migration
  def up
    create_table :messages do
      primary_key :id
      integer :user_id
      string :name
      boolean :direct
      datetime :created_at
      datetime :updated_at
    end
  end

  def down
    execute "DROP TABLE messages"
  end

end

a class with

class Message < Sequel::Model
  is :timestamped
  belongs_to :user
end

will be autotimestamped