Skip to content

Commit e011430

Browse files
committed
Fix robocop offenses
1 parent 7831c32 commit e011430

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

app/controllers/concerns/admin_authorizable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module AdminAuthorizable
22
extend ActiveSupport::Concern
33

44
included do
5-
rescue_from UnpermittedException, with: ->{ render json: { error: "Forbidden" }, status: 403 }
5+
rescue_from UnpermittedException, with: ->{ render(json: { error: "Forbidden" }, status: 403) }
66
end
77

88
def authorize!(action)

app/controllers/concerns/record_accessible.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module RecordAccessible
22
extend ActiveSupport::Concern
33

44
included do
5-
rescue_from ActiveRecord::RecordNotFound, with: ->{ render json: { error: "Not Found" }, status: 404 }
6-
rescue_from ActiveRecord::RecordInvalid, with: ->{ render json: { error: "Bad Request" }, statsu: 400 }
5+
rescue_from ActiveRecord::RecordNotFound, with: ->{ render(json: { error: "Not Found" }, status: 404) }
6+
rescue_from ActiveRecord::RecordInvalid, with: ->{ render(json: { error: "Bad Request" }, statsu: 400) }
77
end
88
end

app/controllers/concerns/token_authenticatable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module TokenAuthenticatable
66

77
attr_reader :current_user
88

9-
rescue_from UnauthorizedException, with: ->{ render json: { error: "Unauthorized" }, status: 401 }
9+
rescue_from UnauthorizedException, with: ->{ render(json: { error: "Unauthorized" }, status: 401) }
1010
end
1111

1212
private

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
7373

7474
if ENV["RAILS_LOG_TO_STDOUT"].present?
75-
logger = ActiveSupport::Logger.new(STDOUT)
75+
logger = ActiveSupport::Logger.new($stdout)
7676
logger.formatter = config.log_formatter
7777
config.logger = ActiveSupport::TaggedLogging.new(logger)
7878
end

config/puma.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# the maximum value specified for Puma. Default is set to 5 threads for minimum
55
# and maximum; this matches the default thread size of Active Record.
66
#
7-
threads_count = ENV.fetch("RAILS_MAX_THREADS"){ 5 }
7+
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
88
threads(threads_count, threads_count)
99

1010
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
1111
#
12-
port(ENV.fetch("PORT"){ 3000 })
12+
port(ENV.fetch("PORT", 3000))
1313

1414
# Specifies the `environment` that Puma will run in.
1515
#

db/migrate/20180323131037_create_posts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CreatePosts < ActiveRecord::Migration[5.1]
22
def change
3-
create_table :posts do |t|
3+
create_table(:posts) do |t|
44
t.text(:title)
55
t.text(:content)
66

db/migrate/20180411154150_create_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CreateUsers < ActiveRecord::Migration[5.1]
22
def change
3-
create_table :users do |t|
3+
create_table(:users) do |t|
44
t.string(:email, null: false)
55
t.string(:password_digest, null: false)
66
t.boolean(:admin, default: false)

db/migrate/20180418152629_create_comments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CreateComments < ActiveRecord::Migration[5.1]
22
def change
3-
create_table :comments do |t|
3+
create_table(:comments) do |t|
44
t.string(:name, default: "anonym")
55
t.string(:message)
66
t.references(:post, foreign_key: true)

0 commit comments

Comments
 (0)