Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration to correct unicode issues that were resolved by #295 #313

Merged
merged 1 commit into from Apr 23, 2014

Conversation

swanson
Copy link
Collaborator

@swanson swanson commented Apr 21, 2014

cc @Koronen

Sanity check for me :)

@swanson
Copy link
Collaborator Author

swanson commented Apr 22, 2014

Probably need to rework after #314

@@ -0,0 +1,12 @@
class FixInvalidUnicode < ActiveRecord::Migration
def up
Story.all.each do |story|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tent to prefer find_each for this kind of situation. find_each fetches and instantiates records in batches, which improves performance for large collections.

@Koronen
Copy link
Contributor

Koronen commented Apr 22, 2014

I'm usually a bit hesitant adding data migrations like this, mainly because classes and fields tend to change over time. In this case though, I'm fine with this migration, since I predict that the class Story and the field Story#body will remain stable for a foreseeable future.

@swanson
Copy link
Collaborator Author

swanson commented Apr 23, 2014

Fixed, squashed, rebased, merged :)

swanson pushed a commit that referenced this pull request Apr 23, 2014
Add migration to correct unicode issues that were resolved by #295
@swanson swanson merged commit 3ddd126 into master Apr 23, 2014
@swanson swanson deleted the add-migration-to-fix-unprintables branch April 23, 2014 00:36
@Koronen
Copy link
Contributor

Koronen commented Apr 23, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants