Skip to content

Instantly share code, notes, and snippets.

@muslih
Last active December 19, 2015 10:29
Show Gist options
  • Save muslih/5940513 to your computer and use it in GitHub Desktop.
Save muslih/5940513 to your computer and use it in GitHub Desktop.
require 'dm-core'
require 'dm-migrations'
DataMapper.setup(:default, "sqlite3:///#{Dir.pwd}/gabung.db")
class Institusi
include DataMapper::Resource
property :id, Serial
property :nama_institusi, String
property :nilai, Integer
property :tahun_institusi, Integer
property :kode_institusi, String
has n, :users
end
class User
include DataMapper::Resource
property :id, Serial
property :nama, String
property :institusi_id, Integer
property :umur, Integer
belongs_to :institusi
end
DataMapper.finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment