Created
April 28, 2015 21:02
-
-
Save lynndylanhurley/c309c48685f4387f4fb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class AddSubmissionTimesToSubmittedApps < ActiveRecord::Migration | |
def change | |
# set all currently submitted applications submitted_at time to now | |
ProgramApplication.where(company: nil, ready_to_submit: true).each{|app| | |
unless app.company | |
app.company = Company.create!(name: 'unnamed') | |
end | |
app.submitted_at = Time.now | |
app.save! | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment