Skip to content

Instantly share code, notes, and snippets.

@asanghi
Created May 7, 2011 14:31
Show Gist options
  • Save asanghi/960538 to your computer and use it in GitHub Desktop.
Save asanghi/960538 to your computer and use it in GitHub Desktop.
Why instance methods?
# Wouldnt it be cool if the Migration was further DSLed up to be just
class CreatePosts < ActiveRecord::Migration
change(:raise_down_error => false, :no_foreign_key_index => true) do
create_table :posts do |t|
t.string :title
t.text :body
t.timestamps
end
end
up(:if => Proc.new{}) do
# stuff here
end
down do
# stuff here
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment