Apply Style/SymbolProc rubocop rule
This style is much more concise.
This commit is contained in:
@@ -36,7 +36,7 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController
|
||||
end
|
||||
|
||||
def search_officers
|
||||
@officers = User.search(params[:search]).order(username: :asc).select { |o| o.poll_officer? }
|
||||
@officers = User.search(params[:search]).order(username: :asc).select(&:poll_officer?)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -8,7 +8,7 @@ class Admin::SettingsController < Admin::BaseController
|
||||
:poster_feature_short_title_setting, :poster_feature_description_setting
|
||||
|
||||
def index
|
||||
all_settings = Setting.all.group_by { |setting| setting.type }
|
||||
all_settings = Setting.all.group_by(&:type)
|
||||
@configuration_settings = all_settings["configuration"]
|
||||
@feature_settings = all_settings["feature"]
|
||||
@participation_processes_settings = all_settings["process"]
|
||||
|
||||
@@ -9,7 +9,7 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomizati
|
||||
def index
|
||||
@content_blocks = SiteCustomization::ContentBlock.order(:name, :locale)
|
||||
@headings_content_blocks = Budget::ContentBlock.all
|
||||
all_settings = Setting.all.group_by { |setting| setting.type }
|
||||
all_settings = Setting.all.group_by(&:type)
|
||||
@html_settings = all_settings["html"]
|
||||
end
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class Admin::SystemEmailsController < Admin::BaseController
|
||||
end
|
||||
|
||||
def load_sample_reply
|
||||
reply = Comment.select { |comment| comment.reply? }.last
|
||||
reply = Comment.select(&:reply?).last
|
||||
if reply
|
||||
@email = ReplyEmail.new(reply)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user