Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def show
# Clicking the "Fullfill" button will set the the request to fulfilled
# and will move the user to the new distribution page with a
# pre-filled distribution containing all the requested items.


#Add here

def fullfill
request = Request.find(params[:id])
request.update(status: "Fulfilled")
Expand Down
2 changes: 1 addition & 1 deletion app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Request < ApplicationRecord

scope :active, -> { where(status: "Active") }

STATUSES = %w[Active Fulfilled].freeze
STATUSES = %w[Active Started Fulfilled].freeze

def items_hash
@items_hash ||= request_items.collect do |key, _|
Expand Down