public
Description: Sequel Model plugin to implicitly set created_at and updated_at
Clone URL: git://github.com/bricooke/sequel_timestamped.git
Search Repo:
Update readme with example
bricooke (author)
Thu Apr 10 09:49:25 -0700 2008
commit  16326ed2934193f7601273de68565c26d7ed19ac
tree    9849ea06c69ca1b2c37fe6199632319682e9eec6
parent  4a9c255651aa2058b0089d4f6eaa6b31f9bed916
0
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
0
@@ -1,3 +1,32 @@
0
 If your model is :timestamped, it will automatically set the
0
 :created_at and :updated_at columns if they exist
0
+
0
+With a migration like:
0
+
0
+class MessageMigration < Sequel::Migration
0
+ def up
0
+ create_table :messages do
0
+ primary_key :id
0
+ integer :user_id
0
+ string :name
0
+ boolean :direct
0
+ datetime :created_at
0
+ datetime :updated_at
0
+ end
0
+ end
0
+
0
+ def down
0
+ execute "DROP TABLE messages"
0
+ end
0
+
0
+end
0
+
0
+a class with
0
+
0
+class Message < Sequel::Model
0
+ is :timestamped
0
+ belongs_to :user
0
+end
0
+
0
+will be autotimestamped

Comments

    No one has commented yet.