Simplify result of find_noteable
This commit is contained in:
parent
9079085fe7
commit
5469d21d02
|
@ -78,9 +78,7 @@ module API
|
|||
|
||||
noteable = NotesFinder.new(user_project, current_user, params).target
|
||||
noteable = nil unless can?(current_user, noteable_read_ability_name(noteable), noteable)
|
||||
return not_found!(noteable_type) unless noteable
|
||||
|
||||
noteable
|
||||
noteable || not_found!(noteable_type)
|
||||
end
|
||||
|
||||
def params_by_noteable_type_and_id(type, id)
|
||||
|
|
Loading…
Reference in New Issue