Browse Source

Linting

pull/51/head
baarkerlounger 3 years ago
parent
commit
5248a96db3
  1. 4
      app/controllers/case_logs_controller.rb
  2. 2
      app/models/case_log.rb
  3. 2
      app/models/form_handler.rb
  4. 2
      spec/requests/case_log_controller_spec.rb

4
app/controllers/case_logs_controller.rb

@ -25,7 +25,7 @@ class CaseLogsController < ApplicationController
end
def update
if case_log = CaseLog.find_by(id: params[:id])
if (case_log = CaseLog.find_by(id: params[:id]))
if case_log.update(api_case_log_params)
render json: case_log, status: :ok
else
@ -64,7 +64,7 @@ class CaseLogsController < ApplicationController
end
def destroy
if case_log = CaseLog.find_by(id: params[:id])
if (case_log = CaseLog.find_by(id: params[:id]))
if case_log.discard
head :no_content
else

2
app/models/case_log.rb

@ -58,7 +58,7 @@ class CaseLog < ApplicationRecord
status == "in_progress"
end
private
private
def update_status!
self.status = if all_fields_completed? && errors.empty?

2
app/models/form_handler.rb

@ -12,8 +12,8 @@ class FormHandler
@forms[form] ||= Form.new(form)
end
private
private
def get_all_forms
forms = {}
directories = ["config/forms", "spec/fixtures/forms"]

2
spec/requests/case_log_controller_spec.rb

@ -128,7 +128,7 @@ RSpec.describe CaseLogsController, type: :request do
end
context "invalid case log params" do
let(:params) { {tenant_age: 200} }
let(:params) { { tenant_age: 200 } }
it "returns 422" do
expect(response).to have_http_status(:unprocessable_entity)

Loading…
Cancel
Save