Commit 9b92f5d3 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Extract scoped issue availability check to a method

parent 0912e9e9
......@@ -801,21 +801,18 @@ module API
# EE-specific
# Default filtering configuration
expose :milestone,
using: Entities::Milestone,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :assignee,
using: Entities::UserBasic,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :labels,
using: Entities::LabelBasic,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :weight,
if: -> (board, _) { board.parent.feature_available?(:scoped_issue_board) }
expose :milestone, using: Entities::Milestone, if: -> (board, _) { scoped_issue_available?(board) }
expose :assignee, using: Entities::UserBasic, if: -> (board, _) { scoped_issue_available?(board) }
expose :labels, using: Entities::LabelBasic, if: -> (board, _) { scoped_issue_available?(board) }
expose :weight, if: -> (board, _) { scoped_issue_available?(board) }
expose :lists, using: Entities::List do |board|
board.lists.destroyable
end
def scoped_issue_available?(board)
board.parent.feature_available?(:scoped_issue_board)
end
end
class Compare < Grape::Entity
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment