-
-
Save anonymous/2e2a44d44029cd43f5fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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