Sequel newbie here...

Is there anything I am missing? Do I need to import plugins separately
from 'sequel'? How to do that?

require 'rubygems'
require 'sequel'

DB = Sequel.sqlite

DB.create_table(:posts) do
  primary_key :id
  String :name
  DateTime :updated_at
  DateTime :created_at
  TrueClass :published
end

class Posts < Sequel::Model(:posts)
  plugin :timestamps
end

Posts.insert(:name => "John Smith")

Posts.all # => [#<Posts @values={:id=>1, :name=>"John
Smith", :updated_at=>nil, :created_at=>nil, :published=>nil}>]




Also,  running the below in irb returns false:

require 'sequel'
Sequel::Model.plugin :timestamps
returns false

similarly, if I import the code above,
Posts.plugin :timestamps returns false, too.

Am I missing something?

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to