Browse Source

Fix `Lint/RedundantSafeNavigation` cop (#28172)

dariusk-working/4_3_0
Matt Jankowski 2 years ago committed by GitHub
parent
commit
d83d01eb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/controllers/api/v1/accounts_controller.rb
  2. 2
      app/models/trends/history.rb

2
app/controllers/api/v1/accounts_controller.rb

@ -49,7 +49,7 @@ class Api::V1::AccountsController < Api::BaseController
end
def mute
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications), duration: (params[:duration]&.to_i || 0))
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications), duration: params[:duration].to_i)
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships
end

2
app/models/trends/history.rb

@ -37,7 +37,7 @@ class Trends::History
end
def uses
with_redis { |redis| redis.get(key_for(:uses))&.to_i || 0 }
with_redis { |redis| redis.get(key_for(:uses)).to_i }
end
def add(account_id)

Loading…
Cancel
Save