Merge pull request #2146 from basecamp/show-only-published-cards-on-public-boards

Show only public cards on public boards
This commit is contained in:
Stanko Krtalić
2025-12-15 13:26:12 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class Public::BaseController < ApplicationController
end
def set_card
@card = @board.cards.find_by!(number: params[:id]) if params[:board_id] && params[:id]
@card = @board.cards.published.find_by!(number: params[:id]) if params[:board_id] && params[:id]
end
def set_public_cache_expiration
@@ -18,4 +18,10 @@ class Public::CardsControllerTest < ActionDispatch::IntegrationTest
get public_board_card_path(@board.publication.key, @card)
assert_response :not_found
end
test "not found if the card is drafted" do
@card.update!(status: :drafted)
get public_board_card_path(@board.publication.key, @card)
assert_response :not_found
end
end