Improved error handling.

This commit is contained in:
Martin Edenhofer 2016-02-08 23:05:59 +01:00
parent 254e3be807
commit c91a497650
7 changed files with 26 additions and 18 deletions

View file

@ -32,8 +32,9 @@ returns
%w(created_by_id updated_by_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ] && data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end

View file

@ -52,8 +52,9 @@ returns
%w(created_by_id updated_by_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ] && data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end

View file

@ -24,8 +24,10 @@ returns
def assets (data)
if !data[ User.to_app_model ] || !data[ User.to_app_model ][ self['created_by_id'] ]
user = User.lookup( id: self['created_by_id'] )
data = user.assets( data )
user = User.lookup(id: self['created_by_id'])
if user
data = user.assets(data)
end
end
data

View file

@ -46,10 +46,10 @@ returns
local_attributes['member_ids'] = local_member_ids
if local_member_ids
local_member_ids.each {|local_user_id|
if !data[ User.to_app_model ][ local_user_id ]
user = User.lookup( id: local_user_id )
data = user.assets( data )
end
next if data[ User.to_app_model ][ local_user_id ]
user = User.lookup(id: local_user_id)
next if !user
data = user.assets(data)
}
end
@ -58,8 +58,9 @@ returns
%w(created_by_id updated_by_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end

View file

@ -44,8 +44,9 @@ returns
%w(created_by_id updated_by_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ] && data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end

View file

@ -31,8 +31,9 @@ returns
%w(created_by_id updated_by_id owner_id customer_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ] && data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end

View file

@ -111,8 +111,9 @@ returns
%w(created_by_id updated_by_id).each {|local_user_id|
next if !self[ local_user_id ]
next if data[ User.to_app_model ][ self[ local_user_id ] ]
user = User.lookup( id: self[ local_user_id ] )
data = user.assets( data )
user = User.lookup(id: self[ local_user_id ])
next if !user
data = user.assets(data)
}
data
end