Skip to content

Commit

Permalink
specify id as primary key for sequel
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wiggins committed Nov 4, 2008
1 parent b32ccd2 commit 81ffae5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/post.rb
Expand Up @@ -2,14 +2,14 @@
require 'syntax/convertors/html'

class Post < Sequel::Model
set_primary_key [ :id ]
set_schema do
serial :id
text :title
text :body
text :slug
text :tags
timestamp :created_at
primary_key [ :id ]
end

def url
Expand Down
2 changes: 1 addition & 1 deletion main.rb
Expand Up @@ -3,7 +3,7 @@
require 'sequel'

configure do
DB = Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://blog.db')
Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://blog.db')

require 'ostruct'
Blog = OpenStruct.new(
Expand Down
2 changes: 1 addition & 1 deletion spec/base.rb
Expand Up @@ -2,7 +2,7 @@
require 'spec'
require 'sequel'

DB = Sequel.sqlite
Sequel.sqlite

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
require 'post'
Expand Down

0 comments on commit 81ffae5

Please sign in to comment.