From 2a101fc9de2d8d823498af81dc098645430d02e9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 5 Jul 2015 10:08:03 +0200 Subject: [PATCH] Set temp. current attributes to assets pool to prevent lookup loops. --- app/models/organization/assets.rb | 4 ++++ app/models/user/assets.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/models/organization/assets.rb b/app/models/organization/assets.rb index cba3d76e6..2403f8b5c 100644 --- a/app/models/organization/assets.rb +++ b/app/models/organization/assets.rb @@ -32,6 +32,10 @@ returns if !data[ Organization.to_app_model ][ id ] local_attributes = attributes + # set temp. current attributes to assets pool to prevent + # loops, will be updated with lookup attributes later + data[ Organization.to_app_model ][ id ] = local_attributes + # get organizations key = "Organization::member_ids::#{id}" local_member_ids = Cache.get(key) diff --git a/app/models/user/assets.rb b/app/models/user/assets.rb index 7801168a4..05c8ab8d7 100644 --- a/app/models/user/assets.rb +++ b/app/models/user/assets.rb @@ -32,6 +32,10 @@ returns # do not transfer crypted pw local_attributes['password'] = '' + # set temp. current attributes to assets pool to prevent + # loops, will be updated with lookup attributes later + data[ User.to_app_model ][ id ] = local_attributes + # get linked accounts local_attributes['accounts'] = {} key = "User::authorizations::#{id}"