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
require 'rubygems' | |
require 'dm-core' | |
gem 'dm-core', '0.10.2' | |
class Post | |
include DataMapper::Resource | |
# !> method redefined; discarding old one? | |
property :id, Serial | |
property :title, String | |
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
require 'rubygems' | |
require 'dm-core' | |
class Person | |
include DataMapper::Resource | |
property :id, Serial | |
property :first_name, String | |
end |
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
development: | |
adapter: master_slave | |
master: | |
adapter: mysql | |
database: master | |
host: master_server | |
slave: | |
adapter: mysql | |
database: slave | |
host: localhost |
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
module Enumerable | |
def forked_each(n = 50, &block) | |
self.each_slice(n) do |items| | |
fork do | |
GC.disable | |
items.each { |item| block.call(item) } | |
end | |
Process.wait | |
end |
OlderNewer