Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save abacha/5117163 to your computer and use it in GitHub Desktop.

Select an option

Save abacha/5117163 to your computer and use it in GitHub Desktop.
class MoveFundGroupFromFundsToCrawlers < ActiveRecord::Migration
def change
add_column :crawlers, :fund_group, :integer
Fund.all.each do |fund|
fund.crawler.update_attributes(:fund_group => fund.fund_group) if fund.fund_group && !fund.crawler.nil?
end
remove_column :funds, :fund_group
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment