mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
Update legacy registrar codes just in case
This commit is contained in:
parent
8f23ef510d
commit
2e4bf0ee6e
2 changed files with 13 additions and 1 deletions
12
db/migrate/20150504110926_validate_registrar_codes.rb
Normal file
12
db/migrate/20150504110926_validate_registrar_codes.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class ValidateRegistrarCodes < ActiveRecord::Migration
|
||||
def change
|
||||
Registrar.all.each do |registrar|
|
||||
if registrar.code.present?
|
||||
registrar.update_column(:code, registrar.code.gsub(/[ :]/, '').upcase)
|
||||
else
|
||||
puts "NB! FOUND REGISTRAR WITHOUT CODE (HANDLER): #{registrar.id}; #{registrar.name}"
|
||||
puts "Please add registrar code manually in database!"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150504104922) do
|
||||
ActiveRecord::Schema.define(version: 20150504110926) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue