Sha256: 205b24443f51376015d11ff9ba4a489b7457a894d3d731ed851dbb69df58e849

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

require 'sequel'

DB = Sequel.sqlite

class User < Sequel::Model(:user)
  set_schema do
    primary_key :id

    text :nick
    text :password
    text :email
    time :created
  end
end

class Page < Sequel::Model(:page)
  include Ramaze::LinkHelper

  set_schema do
    primary_key :id

    text :text
  end

  def url
    R(PageController, :view, id)
  end

end

[ User, Page ].each do |model|
  model.create_table! unless model.table_exists?
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.3.0 examples/rammit/src/model.rb
ramaze-0.3.5 examples/rammit/src/model.rb