mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
This commit is contained in:
@ -25,7 +25,7 @@ class GroupsController < ApplicationController
|
||||
|
||||
def find_group(param_name)
|
||||
name = params.require(param_name)
|
||||
group = Group.where("lower(name) = ?", name.downcase).first
|
||||
group = Group.find_by("lower(name) = ?", name.downcase)
|
||||
guardian.ensure_can_see!(group)
|
||||
group
|
||||
end
|
||||
|
Reference in New Issue
Block a user