Improved code layout.

This commit is contained in:
Martin Edenhofer 2017-10-16 15:45:04 +02:00
parent 383eee4db9
commit 228a0df54a
3 changed files with 6 additions and 3 deletions

View file

@ -44,7 +44,7 @@ returns
overviews_list = []
overviews.each do |overview|
user_ids = overview.user_ids
next if !user_ids.empty? && !user_ids.include?(current_user.id)
next if user_ids.present? && !user_ids.include?(current_user.id)
overviews_list.push overview
end
overviews_list

View file

@ -58,6 +58,7 @@ returns
# get roles
if local_attributes['role_ids']
local_attributes['role_ids'].each do |role_id|
next if data[:Role] && data[:Role][role_id]
role = Role.lookup(id: role_id)
data = role.assets(data)
end
@ -66,6 +67,7 @@ returns
# get groups
if local_attributes['group_ids']
local_attributes['group_ids'].each do |group_id, _access|
next if data[:Group] && data[:Group][group_id]
group = Group.lookup(id: group_id)
next if !group
data = group.assets(data)
@ -75,6 +77,7 @@ returns
# get organizations
if local_attributes['organization_ids']
local_attributes['organization_ids'].each do |organization_id|
next if data[:Organization] && data[:Organization][organization_id]
organization = Organization.lookup(id: organization_id)
next if !organization
data = organization.assets(data)
@ -86,7 +89,7 @@ returns
# add organization
if self.organization_id
if !data[ Organization.to_app_model ] || !data[ Organization.to_app_model ][ self.organization_id ]
if !data[:Organization] || !data[:Organization][self.organization_id]
organization = Organization.lookup(id: self.organization_id)
if organization
data = organization.assets(data)

View file

@ -23,7 +23,7 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base
index_and_lists = Ticket::Overviews.index(@user)
# no data exists
return if !index_and_lists || index_and_lists.empty?
return if index_and_lists.blank?
# no change exists
return if @last_change == index_and_lists