Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created November 10, 2009 16:39
Show Gist options
  • Save edavis10/231017 to your computer and use it in GitHub Desktop.
Save edavis10/231017 to your computer and use it in GitHub Desktop.
Setting the created_on field
issue = Issue.find(100)
issue.created_on = 10.days.ago
issue.save
# Or if you wanted to "create" the issues based on their start_date
Issue.all.each do |issue|
issue.created_on = issue.start_date
issue.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment