Undo Syck overriding the YAML constant

pull/4862/head
Oliver Günther 8 years ago
parent fecc4f2798
commit f0a854b390
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 8
      db/migrate/migration_utils/legacy_yamler.rb

@ -70,6 +70,14 @@ module Migration
def load_syck
require 'syck'
# WARNING: Syck redefines the YAML constant
# https://github.com/ruby/syck/commit/9d0c50ca87097b12ce17323c3a4fd1d4066298fc
Object.class_eval <<-EORB, __FILE__, __LINE__ + 1
remove_const 'YAML' if defined? YAML
YAML = ::Psych
EORB
::Syck
rescue LoadError => e

Loading…
Cancel
Save