From 7ec70323bf4d7a6f4c463d5baabff602f41fc124 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Thu, 2 Apr 2020 05:08:58 +0300 Subject: [PATCH] Fix migration - scrypt --- db/migrate/20200401031518_update_passwords_to_scrypt.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/migrate/20200401031518_update_passwords_to_scrypt.rb b/db/migrate/20200401031518_update_passwords_to_scrypt.rb index da48d17..531f7ba 100644 --- a/db/migrate/20200401031518_update_passwords_to_scrypt.rb +++ b/db/migrate/20200401031518_update_passwords_to_scrypt.rb @@ -2,10 +2,9 @@ ENV['SCRYPT_MAX_TIME'] ||= "0.03" class UpdatePasswordsToScrypt < ActiveRecord::Migration[6.0] require 'scrypt' - require 'user' def up - SCrypt::Engine.calibrate!(max_time: ENV['SCRYPT_MAX_TIME']) + SCrypt::Engine.calibrate!(max_time: ENV['SCRYPT_MAX_TIME'].to_f) ActiveRecord::Base.transaction do User.all.order(:id).each do |user| user.team = nil unless user&.team&.present?