Skip to content

Commit ddd8812

Browse files
committed
Run standard
1 parent efd5b8f commit ddd8812

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

lib/typical_situation.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

3-
require 'typical_situation/identity'
4-
require 'typical_situation/permissions'
5-
require 'typical_situation/actions'
6-
require 'typical_situation/operations'
7-
require 'typical_situation/responses'
3+
require "typical_situation/identity"
4+
require "typical_situation/permissions"
5+
require "typical_situation/actions"
6+
require "typical_situation/operations"
7+
require "typical_situation/responses"
88

99
module TypicalSituation
1010
class Error < StandardError; end

lib/typical_situation/responses.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def respond_as_created
6868
end
6969
format.json do
7070
render json: serialize_resource(@resource),
71-
location: location_url,
72-
status: :created
71+
location: location_url,
72+
status: :created
7373
end
7474
end
7575
end
@@ -82,11 +82,11 @@ def respond_as_error
8282
format.html do
8383
set_single_instance
8484
render action: (@resource.new_record? ? :new : :edit),
85-
status: :unprocessable_entity
85+
status: :unprocessable_entity
8686
end
8787
format.json do
8888
render json: serialize_resource(@resource, methods: [:errors]),
89-
status: :unprocessable_entity
89+
status: :unprocessable_entity
9090
end
9191
end
9292
end
@@ -114,7 +114,7 @@ def respond_as_not_found
114114
yield(format) if block_given?
115115

116116
format.html do
117-
raise ActionController::RoutingError, 'Not Found'
117+
raise ActionController::RoutingError, "Not Found"
118118
end
119119
format.json do
120120
head :not_found
@@ -124,21 +124,21 @@ def respond_as_not_found
124124

125125
def respond_as_forbidden
126126
respond_to do |format|
127-
format.html { render plain: 'Forbidden', status: :forbidden }
127+
format.html { render plain: "Forbidden", status: :forbidden }
128128
format.json { head :forbidden }
129129
end
130130
end
131131

132132
def after_resource_created_path(resource)
133-
{ action: :show, id: resource.id }
133+
{action: :show, id: resource.id}
134134
end
135135

136136
def after_resource_updated_path(resource)
137-
{ action: :show, id: resource.id }
137+
{action: :show, id: resource.id}
138138
end
139139

140140
def after_resource_destroyed_path(_resource)
141-
{ action: :index }
141+
{action: :index}
142142
end
143143

144144
# HTML response when @resource saved or updated.

0 commit comments

Comments
 (0)