cloud_controller/app/models/app.rb
def set_defaults
- self.metadata ||= {}
+ self.metadata = {} if new_record?
end
- ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
| ==> actionmailer/CHANGELOG <== | |
| ## Rails 3.0.18 | |
| ## Rails 3.0.17 (Aug 9, 2012) | |
| * No changes. | |
| ## Rails 3.0.16 (Jul 26, 2012) | |
| * No changes. |
| apt-get install -qqy gdb | |
| cat > ~/.gdbinit <<EOF | |
| define eval | |
| call(rb_p(rb_eval_string_protect(\$arg0,(int*)0))) | |
| end | |
| define redirect_stdout | |
| call rb_eval_string("\$_old_stdout, \$stdout = \$stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); \$stdout.sync = true") |
| # yield chunks (Array) of the full query to a block | |
| # generates new Collections via self.model.all | |
| # which has the advantage of dropping scope on | |
| # hydrated objects | |
| def block_batches(chunksize, &block) | |
| new_options = self.query.options.dup | |
| total = new_options[:limit] || self.count | |
| new_options[:limit] = chunksize | |
| new_options[:offset] = 0 |