Skip to content

cohuman/sequel_timestamped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sequel Model plugin to implicitly set created_at and updated_at

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages