diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-09-14 12:06:52 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-09-14 12:06:52 +0300 |
commit | 6014019ed49295178ebd0c4ce5f6f1d210219420 (patch) | |
tree | b022c497777679a0cca29df7664d77df59ecfe99 /config | |
parent | 25149ce47eae575b65eb9470d58ea4f71b3b2603 (diff) | |
download | gitlab-ce-6014019ed49295178ebd0c4ce5f6f1d210219420.tar.gz |
monkey patch of Hash
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/hash_patch.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config/initializers/hash_patch.rb b/config/initializers/hash_patch.rb new file mode 100644 index 00000000000..9397d0d1829 --- /dev/null +++ b/config/initializers/hash_patch.rb @@ -0,0 +1,15 @@ +# We need this patch because of json format error in the CI API: +# IOError (not opened for reading) +# Details: http://stackoverflow.com/questions/19808921/upgrade-to-rails-4-got-ioerror-not-opened-for-reading +# It happens because of ActiveSupport's monkey patch of json formatters + +if defined?(ActiveSupport::JSON) + Hash.class_eval do + def to_json(*args) + super(args) + end + def as_json(*args) + super(args) + end + end +end
\ No newline at end of file |