Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2014 19:45
Show Gist options
  • Save anonymous/2e2a44d44029cd43f5fe to your computer and use it in GitHub Desktop.
Save anonymous/2e2a44d44029cd43f5fe to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'dm-core'
require 'dm-migrations'
DataMapper.setup( :default, "sqlite3://#{Dir.pwd}/ju.db" )
DataMapper::Logger.new($stdout, :debug)
class Koniec
include DataMapper::Resource
property :info, String , :key => true
end
DataMapper.finalize
DataMapper.auto_migrate!
DataMapper.auto_upgrade!
p = Koniec.new
p.attributes = {
:info => '_a'+rand(20).floor.to_s,
}
p.save
Koniec.all.each {|a|
p a
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment