ruby 2.3: fix marshalling problem

in ruby 2.1, AllowedServicesHash.reject {} will return a AllowedServicesHash,
on 2.3 it will return a plain Hash. so dup it instead (which returns an
AllowedServicesHash), and then reject! (which doesn't change the type
of the object). this works in both 2.1 and 2.3

Change-Id: Ic6eac219e31cd469afd45d026822654c11180b49
Reviewed-on: https://gerrit.instructure.com/92553
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2016-10-11 14:58:43 -06:00
parent 3ae4218a05
commit 7d58a05063
1 changed files with 3 additions and 1 deletions

View File

@ -78,6 +78,8 @@ module AccountServices
end
def self.default_allowable_services
self.allowable_services.reject {|_, info| info[:default] == false }
res = self.allowable_services.dup
res.reject! {|_, info| info[:default] == false }
res
end
end