Sha256: cfd77a6d9186b26136c2e5c0e98bca94616242bb7a5ffbb5c43378c487f675a1

Contents?: true

Size: 452 Bytes

Versions: 6

Compression:

Stored size: 452 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::Helper::Link

  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

6 entries across 6 versions & 3 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 examples/rammit/src/model.rb
manveru-ramaze-2008.07 examples/app/rammit/src/model.rb
manveru-ramaze-2008.08 examples/app/rammit/src/model.rb
ramaze-0.3.9 examples/rammit/src/model.rb
ramaze-0.3.9.1 examples/rammit/src/model.rb
ramaze-2008.06 examples/app/rammit/src/model.rb