Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules. Personally I prefer no empty lines around blocks, clases, etc... as recommended by the Ruby style guide [1], and they're the default values in rubocop, so those are the settings I'm applying. The exception is the `private` access modifier, since we were leaving empty lines around it most of the time. That's the default rubocop rule as well. Personally I don't have a strong preference about this one. [1] https://rubystyle.guide/#empty-lines-around-bodies
This commit is contained in:
@@ -5,5 +5,4 @@ class Admin::ActivityController < Admin::BaseController
|
||||
@activity = Activity.for_render.send(@current_filter)
|
||||
.order(created_at: :desc).page(params[:page])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Api::StatsController < Admin::Api::BaseController
|
||||
|
||||
def show
|
||||
unless params[:event].present? ||
|
||||
params[:visits].present? ||
|
||||
|
||||
@@ -10,5 +10,4 @@ class Admin::BaseController < ApplicationController
|
||||
def verify_administrator
|
||||
raise CanCan::AccessDenied unless current_user&.administrator?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -61,5 +61,4 @@ class Admin::BudgetGroupsController < Admin::BaseController
|
||||
valid_attributes = [:max_votable_headings]
|
||||
params.require(:budget_group).permit(*valid_attributes, translation_params(Budget::Group))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -66,5 +66,4 @@ class Admin::BudgetHeadingsController < Admin::BaseController
|
||||
valid_attributes = [:price, :population, :allow_custom_content, :latitude, :longitude]
|
||||
params.require(:budget_heading).permit(*valid_attributes, translation_params(Budget::Heading))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -25,5 +25,4 @@ class Admin::BudgetPhasesController < Admin::BaseController
|
||||
valid_attributes = [:starts_at, :ends_at, :enabled]
|
||||
params.require(:budget_phase).permit(*valid_attributes, translation_params(Budget::Phase))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -109,5 +109,4 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
def load_valuators
|
||||
@valuators = Valuator.includes(:user).all.order(description: :asc).order("users.email ASC")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::CommentsController < Admin::BaseController
|
||||
|
||||
include DownloadSettingsHelper
|
||||
|
||||
def index
|
||||
@@ -16,5 +15,4 @@ class Admin::CommentsController < Admin::BaseController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
class Admin::DashboardController < Admin::BaseController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -16,5 +16,4 @@ class Admin::DebatesController < Admin::BaseController
|
||||
def resource_model
|
||||
Debate
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::GeozonesController < Admin::BaseController
|
||||
|
||||
respond_to :html
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -30,5 +30,4 @@ class Admin::HiddenBudgetInvestmentsController < Admin::BaseController
|
||||
def load_investment
|
||||
@investment = Budget::Investment.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -25,5 +25,4 @@ class Admin::HiddenCommentsController < Admin::BaseController
|
||||
def load_comment
|
||||
@comment = Comment.not_valuations.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -28,5 +28,4 @@ class Admin::HiddenDebatesController < Admin::BaseController
|
||||
def load_debate
|
||||
@debate = Debate.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -29,5 +29,4 @@ class Admin::HiddenProposalsController < Admin::BaseController
|
||||
def load_proposal
|
||||
@proposal = Proposal.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -29,5 +29,4 @@ class Admin::HiddenUsersController < Admin::BaseController
|
||||
def load_user
|
||||
@user = User.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::HomepageController < Admin::BaseController
|
||||
|
||||
def show
|
||||
load_header
|
||||
load_feeds
|
||||
@@ -24,5 +23,4 @@ class Admin::HomepageController < Admin::BaseController
|
||||
def load_feeds
|
||||
@feeds = Widget::Feed.order("created_at")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -10,5 +10,4 @@ class Admin::Legislation::BaseController < Admin::BaseController
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Legislation::ProposalsController < Admin::Legislation::BaseController
|
||||
|
||||
has_orders %w[id title supports], only: :index
|
||||
|
||||
load_and_authorize_resource :process, class: "Legislation::Process"
|
||||
|
||||
@@ -6,5 +6,4 @@ class Admin::LocalCensusRecords::BaseController < Admin::BaseController
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::MilestoneStatusesController < Admin::BaseController
|
||||
|
||||
before_action :load_status, only: [:edit, :update, :destroy]
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::NewslettersController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@newsletters = Newsletter.all
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::OfficialsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@officials = User.officials.page(params[:page]).for_render
|
||||
end
|
||||
@@ -29,5 +28,4 @@ class Admin::OfficialsController < Admin::BaseController
|
||||
def user_params
|
||||
params.require(:user).permit(:official_position, :official_level)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -26,5 +26,4 @@ class Admin::OrganizationsController < Admin::BaseController
|
||||
@organization.reject
|
||||
redirect_to request.query_parameters.merge(action: :index)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -31,5 +31,4 @@ class Admin::Poll::ActivePollsController < Admin::Poll::BaseController
|
||||
def active_poll_params
|
||||
params.require(:active_poll).permit(translation_params(ActivePoll))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -6,5 +6,4 @@ class Admin::Poll::BaseController < Admin::BaseController
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
|
||||
|
||||
before_action :load_poll, except: [:create, :destroy]
|
||||
|
||||
def index
|
||||
@@ -74,5 +73,4 @@ class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
|
||||
def load_search
|
||||
@search = search_params[:search]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -41,5 +41,4 @@ class Admin::Poll::BoothsController < Admin::Poll::BaseController
|
||||
def booth_params
|
||||
params.require(:poll_booth).permit(:name, :location)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController
|
||||
|
||||
before_action :load_poll
|
||||
before_action :redirect_if_blank_required_params, only: [:by_officer]
|
||||
before_action :load_booth_assignment, only: [:create]
|
||||
@@ -66,5 +65,4 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController
|
||||
def load_search
|
||||
@search = search_params[:search]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -29,5 +29,4 @@ class Admin::Poll::OfficersController < Admin::Poll::BaseController
|
||||
@officer.destroy!
|
||||
redirect_to admin_officers_path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Poll::ShiftsController < Admin::Poll::BaseController
|
||||
|
||||
before_action :load_booth
|
||||
before_action :load_officer
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::ProposalNotificationsController < Admin::BaseController
|
||||
|
||||
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
|
||||
|
||||
before_action :load_proposal, only: [:confirm_hide, :restore]
|
||||
@@ -28,5 +27,4 @@ class Admin::ProposalNotificationsController < Admin::BaseController
|
||||
def load_proposal
|
||||
@proposal_notification = ProposalNotification.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -38,5 +38,4 @@ class Admin::ProposalsController < Admin::BaseController
|
||||
def proposal_params
|
||||
params.require(:proposal).permit(:selected)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::SignatureSheetsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@signature_sheets = SignatureSheet.all.order(created_at: :desc)
|
||||
end
|
||||
@@ -29,5 +28,4 @@ class Admin::SignatureSheetsController < Admin::BaseController
|
||||
def signature_sheet_params
|
||||
params.require(:signature_sheet).permit(:signable_type, :signable_id, :required_fields_to_verify)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -6,5 +6,4 @@ class Admin::SiteCustomization::BaseController < Admin::BaseController
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -5,5 +5,4 @@ class Admin::SiteCustomization::CardsController < Admin::SiteCustomization::Base
|
||||
@page = ::SiteCustomization::Page.find(params[:page_id])
|
||||
@cards = @page.cards
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::SiteCustomization::DocumentsController < Admin::SiteCustomization::BaseController
|
||||
|
||||
def index
|
||||
@documents = Document.admin.page(params[:page])
|
||||
end
|
||||
|
||||
@@ -23,7 +23,6 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
redirect_to admin_site_customization_information_texts_path,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::StatsController < Admin::BaseController
|
||||
|
||||
def show
|
||||
@event_types = Ahoy::Event.pluck(:name).uniq.sort
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::SystemEmailsController < Admin::BaseController
|
||||
|
||||
before_action :load_system_email, only: [:view, :preview_pending, :moderate_pending]
|
||||
|
||||
def index
|
||||
|
||||
@@ -27,5 +27,4 @@ class Admin::TagsController < Admin::BaseController
|
||||
def find_tag
|
||||
@tag = Tag.category.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -45,6 +45,7 @@ class Admin::TrackersController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_tracker
|
||||
@tracker = Tracker.find(params[:id])
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::ValuatorGroupsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@groups = ValuatorGroup.all.page(params[:page])
|
||||
end
|
||||
@@ -48,5 +47,4 @@ class Admin::ValuatorGroupsController < Admin::BaseController
|
||||
def group_params
|
||||
params.require(:valuator_group).permit(:name)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -50,5 +50,4 @@ class Admin::ValuatorsController < Admin::BaseController
|
||||
params.require(:valuator).permit(:user_id, :description, :valuator_group_id,
|
||||
:can_comment, :can_edit_dossier)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::VerificationsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@users = User.incomplete_verification.page(params[:page])
|
||||
end
|
||||
@@ -10,5 +9,4 @@ class Admin::VerificationsController < Admin::BaseController
|
||||
.for_render
|
||||
render :index
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -6,5 +6,4 @@ class Admin::Widget::BaseController < Admin::BaseController
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Widget::FeedsController < Admin::BaseController
|
||||
|
||||
def update
|
||||
@feed = ::Widget::Feed.find(params[:id])
|
||||
@feed.update!(feed_params)
|
||||
@@ -12,5 +11,4 @@ class Admin::Widget::FeedsController < Admin::BaseController
|
||||
def feed_params
|
||||
params.require(:widget_feed).permit(:limit)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user