Skip to content
Merged
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
2 changes: 1 addition & 1 deletion app/controllers/additional_expenses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create
if @additional_expense.save
render json: @additional_expense.as_json, status: :created
else
render json: @additional_expense.errors.as_json, status: :unprocessable_entity
render json: @additional_expense.errors.as_json, status: :unprocessable_content
end
end

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/all_casa_admins/casa_admins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create
service.create!
redirect_to all_casa_admins_casa_org_path(@casa_org), notice: "New admin created successfully"
rescue ActiveRecord::RecordInvalid
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -28,7 +28,7 @@ def update
@casa_admin.filter_old_emails!(@casa_admin.email)
redirect_to edit_all_casa_admins_casa_org_casa_admin_path(@casa_org), notice: notice
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand All @@ -39,7 +39,7 @@ def activate

redirect_to edit_all_casa_admins_casa_org_casa_admin_path, notice: "Admin was activated. They have been sent an email."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand All @@ -50,7 +50,7 @@ def deactivate

redirect_to edit_all_casa_admins_casa_org_casa_admin_path, notice: "Admin was deactivated."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/all_casa_admins/casa_orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def create
end
else
respond_to do |format|
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }
format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/all_casa_admins/patch_notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
if @patch_note.save
render json: {status: :created, id: @patch_note.id}, status: :created
else
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content
end
end

Expand All @@ -23,7 +23,7 @@ def update
if @patch_note.update(patch_note_params)
render json: {status: :ok}
else
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content
end
end

Expand All @@ -34,7 +34,7 @@ def destroy
if @patch_note.destroy
render json: {status: :ok}
else
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity
render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content
end
end

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/all_casa_admins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def create
end
rescue ActiveRecord::RecordInvalid
respond_to do |format|
format.html { render :new, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }

format.json do
render json: @all_casa_admin.errors.full_messages, status: :unprocessable_entity
render json: @all_casa_admin.errors.full_messages, status: :unprocessable_content
end
end
end
Expand All @@ -53,8 +53,8 @@ def update
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @user.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @user.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand All @@ -78,8 +78,8 @@ def update_password
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @user.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @user.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/banners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create

redirect_to banners_path
rescue
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end

def update
Expand All @@ -48,7 +48,7 @@ def update

redirect_to banners_path
rescue
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end

def destroy
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/bulk_court_dates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create
case_group_id = params[:court_date][:case_group_id]
if case_group_id.empty?
@court_date = build_court_date_with_error_message
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
return
end

Expand All @@ -26,7 +26,7 @@ def create

if court_date_with_error
@court_date = court_date_with_error
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
else
redirect_to new_bulk_court_date_path, notice: "#{court_dates.size} #{"court date".pluralize(court_dates.size)} created!"
end
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/casa_admins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def update
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down Expand Up @@ -59,8 +59,8 @@ def create
end
rescue ActiveRecord::RecordInvalid
respond_to do |format|
format.html { render :new, status: :unprocessable_entity }
format.json { render json: service.casa_admin.errors.full_messages, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }
format.json { render json: service.casa_admin.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand All @@ -81,8 +81,8 @@ def activate
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content }
end
end
rescue Errno::ECONNREFUSED => error
Expand All @@ -100,8 +100,8 @@ def deactivate
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content }
end
end
rescue Errno::ECONNREFUSED => error
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/casa_cases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def create
set_contact_types
@empty_court_date = court_date_unknown?
respond_to do |format|
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity }
format.html { render :new, status: :unprocessable_content }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand All @@ -79,8 +79,8 @@ def update
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand All @@ -101,8 +101,8 @@ def deactivate
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand All @@ -123,8 +123,8 @@ def reactivate
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/casa_org_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def update
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/case_assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def unassign
end
else
respond_to do |format|
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @case_assignment.errors.full_messages, status: :unprocessable_entity }
format.html { render :edit, status: :unprocessable_content }
format.json { render json: @case_assignment.errors.full_messages, status: :unprocessable_content }
end
end
end
Expand Down Expand Up @@ -133,6 +133,6 @@ def handle_successful_assignment(msg)
def handle_failed_assignment(msg)
@message = msg
flash.alert = msg
@status = :unprocessable_entity
@status = :unprocessable_content
end
end
2 changes: 1 addition & 1 deletion app/controllers/case_contacts/form_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def update
if @case_contact.update(case_contact_params)
render json: @case_contact, status: :ok
else
render json: @case_contact.errors.full_messages, status: :unprocessable_entity
render json: @case_contact.errors.full_messages, status: :unprocessable_content
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/case_court_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate
render json: {status: :not_found, error_messages: error_messages}, status: :not_found
rescue => e
error_messages = generate_error(e.to_s)
render json: {status: :unprocessable_entity, error_messages: error_messages}, status: :unprocessable_entity
render json: {status: :unprocessable_content, error_messages: error_messages}, status: :unprocessable_content
end

private
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/case_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create
if @case_group.save
redirect_to case_groups_path, notice: "Case group created!"
else
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -33,7 +33,7 @@ def update
if @case_group.update(case_group_params)
redirect_to case_groups_path, notice: "Case group updated!"
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/checklist_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
set_checklist_updated_date(@hearing_type)
redirect_to edit_hearing_type_path(@hearing_type), notice: "Checklist item was successfully created."
else
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -25,7 +25,7 @@ def update
set_checklist_updated_date(@hearing_type)
redirect_to edit_hearing_type_path(@hearing_type), notice: "Checklist item was successfully updated."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/contact_topic_answers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create
if @contact_topic_answer.save
render json: @contact_topic_answer.as_json, status: :created
else
render json: @contact_topic_answer.errors.as_json, status: :unprocessable_entity
render json: @contact_topic_answer.errors.as_json, status: :unprocessable_content
end
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/contact_topics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create
if @contact_topic.save
redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully created."
else
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -32,7 +32,7 @@ def update
if @contact_topic.update(contact_topic_params)
redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully updated."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand All @@ -43,7 +43,7 @@ def soft_delete
if @contact_topic.update(soft_delete: true)
redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully removed."
else
render :show, status: :unprocessable_entity
render :show, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/contact_type_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create
if @contact_type_group.save
redirect_to edit_casa_org_path(current_organization), notice: "Contact Type Group was successfully created."
else
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -27,7 +27,7 @@ def update
if @contact_type_group.update(contact_type_group_params)
redirect_to edit_casa_org_path(current_organization), notice: "Contact Type Group was successfully updated."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/contact_types_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create
if @contact_type.save
redirect_to edit_casa_org_path(current_organization), notice: "Contact Type was successfully created."
else
render :new, status: :unprocessable_entity
render :new, status: :unprocessable_content
end
end

Expand All @@ -27,7 +27,7 @@ def update
if @contact_type.update(contact_type_params)
redirect_to edit_casa_org_path(current_organization), notice: "Contact Type was successfully updated."
else
render :edit, status: :unprocessable_entity
render :edit, status: :unprocessable_content
end
end

Expand Down
Loading
Loading