Skip to content

Commit

Permalink
Add migration to correct unicode issues that were resolved by #295
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Swanson committed Apr 21, 2014
1 parent 5a352e7 commit ca84bb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions db/migrate/20140421224454_fix_invalid_unicode.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class FixInvalidUnicode < ActiveRecord::Migration
def up
Story.all.each do |story|
story.body = story.body.gsub(/[^[:print:]]/, '')
story.save
end
end

def down
# skip
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20130905204142) do
ActiveRecord::Schema.define(version: 20140421224454) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down

0 comments on commit ca84bb5

Please sign in to comment.