Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-maltsev committed Nov 30, 2016
1 parent 6aa1a16 commit 0075ee6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/ientities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ def ientity_show_list
else
if params[:res_id].present?
iresource = IResource.where(:id => params[:res_id]).first
if iresource.has_entities == true && IResource.available_for_user(params[:res_id], User.current.id)
ies = iresource.ientities.active.select(['i_entities.id',:name, :ipv4])
if iresource.has_entities && IResource.available_for_user(params[:res_id], User.current.id)
if iresource.has_ip
ies = iresource.ientities.active.select(['i_entities.id',:name, :ipv4])
else
ies = iresource.ientities.active.select(['i_entities.id',:name])
end
else
ies = []
end
Expand Down

0 comments on commit 0075ee6

Please sign in to comment.