mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-05 12:42:48 -05:00
- 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.
20 lines
601 B
Ruby
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
|