Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore invalid user records in migration

They might be invalid for other reasons (eg they have been around for longer
than a given validation that it fails).
  • Loading branch information...
commit 6b4246e2220bafe44006aa582c09e173ff1547a6 1 parent 688f7d7
@jamiecobbett jamiecobbett authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 db/migrate/20130111114224_change_permissions_to_array.rb
View
4 db/migrate/20130111114224_change_permissions_to_array.rb
@@ -14,7 +14,7 @@ def self.up
User.all.each do |user|
if user.permissions.is_a?(Hash)
user.permissions = user.permissions["Panopticon"]
- user.save!
+ user.save(validate: false)
end
end
end
@@ -23,7 +23,7 @@ def self.down
User.all.each do |user|
unless user.permissions.nil?
user.permissions = { "Panopticon" => user.permissions }
- user.save!
+ user.save(validate: false)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.