Files
growstuff/app/controllers/stalls_controller.rb
T
Brenda Wallace f18fc64f03 Update stall opening logic and flash message handling
- Modify the create action in OpeningsController to use a localized notice for stall opening.
- Adjust the show action in StallsController to reflect the new opening logic.
- Enhance tests to verify the new flash message and UI behavior when the stall is opened.
2026-11-02 18:06:42 +13:00

20 lines
601 B
Ruby

# frozen_string_literal: true
# A member's garden stall, shared by link. Only the owner sees it while it is
# closed.
class StallsController < ApplicationController
include FeatureGated
require_feature :garden_stall
def show
@member = Member.confirmed.find_by!(slug: params[:member_slug])
@owner = @member == current_member
@stall = @member.stall || @member.build_stall
raise ActiveRecord::RecordNotFound unless @stall.open? || @owner
# The shutter rolls up when the owner arrives from opening it.
@opening = @owner && @stall.open? && flash.notice.present?
end
end