Joined September 2012

Alexandr Korsak

Belarus, Minsk

You are shared the awesome stuff. I've just used it for my production server.

Thank you!

Update the steps:

rbenv local ree-1.8.7-2012.02
gem install bundler
git clone
cd libv8
git checkout v3.16.14.3
echo "source ''\ngem 'rubyzip', '0.9.7' \ngemspec\n" > Gemfile
gem update --system
rake checkout
curl -o patches/my-patch
git add patches/my-patch.patch
rake install
gem install therubyracer -v '0.12.0'

As for me it's more readable like a sentence. I think it depends on a developer anyway.

Hi Richard.

Probably I have few improvements for your the first migration class. I think you should add your code under self.up method instead of using unreversible code in the change method.

Also in few months another dev can come to your team and run all migrations for some reasons instead of using schema:load and I think it would be great to define something like this before def self.up or def self.down methods:

class Coupon < ActiveRecord::Base ; end

It will skip validations for another possible things that can terminate your code.

Or instead of using create method I think it's better to use create! and wrap this code using transactions like this:

Coupon.transaction do
Coupon.findeach do |coupon|
:kind => coupon.kind,
:discount =>,
:coupon_id =>

If something throws exception database will rollback changes.

392 Karma
12,888 Total ProTip Views