mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove hash-like access from service contracts
We decided to keep only one way to access values from a contract. This patch thus removes the hash-like access from contracts.
This commit is contained in:
committed by
Loïc Guitaut
parent
4d0ed2e146
commit
2f334964f2
@@ -30,11 +30,11 @@ class User::Silence
|
||||
private
|
||||
|
||||
def fetch_user(params:)
|
||||
User.find_by(id: params[:user_id])
|
||||
User.find_by(id: params.user_id)
|
||||
end
|
||||
|
||||
def fetch_users(user:, params:)
|
||||
[user, *User.where(id: params[:other_user_ids].to_a.uniq).to_a]
|
||||
[user, *User.where(id: params.other_user_ids.to_a.uniq).to_a]
|
||||
end
|
||||
|
||||
def can_silence_all_users(guardian:, users:)
|
||||
@@ -46,7 +46,7 @@ class User::Silence
|
||||
end
|
||||
|
||||
def fetch_post(params:)
|
||||
Post.find_by(id: params[:post_id])
|
||||
Post.find_by(id: params.post_id)
|
||||
end
|
||||
|
||||
def perform_post_action(guardian:, post:, params:)
|
||||
|
||||
@@ -30,11 +30,11 @@ class User::Suspend
|
||||
private
|
||||
|
||||
def fetch_user(params:)
|
||||
User.find_by(id: params[:user_id])
|
||||
User.find_by(id: params.user_id)
|
||||
end
|
||||
|
||||
def fetch_users(user:, params:)
|
||||
[user, *User.where(id: params[:other_user_ids].to_a.uniq).to_a]
|
||||
[user, *User.where(id: params.other_user_ids.to_a.uniq).to_a]
|
||||
end
|
||||
|
||||
def can_suspend_all_users(guardian:, users:)
|
||||
@@ -46,7 +46,7 @@ class User::Suspend
|
||||
end
|
||||
|
||||
def fetch_post(params:)
|
||||
Post.find_by(id: params[:post_id])
|
||||
Post.find_by(id: params.post_id)
|
||||
end
|
||||
|
||||
def perform_post_action(guardian:, post:, params:)
|
||||
|
||||
Reference in New Issue
Block a user