From 41da2ae6b4d0e5094ad06b579ad7f404446f4ef7 Mon Sep 17 00:00:00 2001 From: Matthias Viehweger Date: Mon, 20 Jan 2020 20:26:47 +0100 Subject: [PATCH] Conform to linter and styleguide --- app/abilities/sbv/role_ability.rb | 6 +----- app/controllers/song_counts_controller.rb | 12 +++++------- app/jobs/export/song_counts_export_job.rb | 2 -- app/models/role/musikkommission_praesident.rb | 6 ------ 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/app/abilities/sbv/role_ability.rb b/app/abilities/sbv/role_ability.rb index 6563e0c0..780fb0bf 100644 --- a/app/abilities/sbv/role_ability.rb +++ b/app/abilities/sbv/role_ability.rb @@ -10,13 +10,9 @@ module RoleAbility included do on(Role) do permission(:group_full).may(:create_history_member).in_same_group - permission(:group_and_below_full).may(:create_history_member).in_same_group_or_below - permission(:layer_full).may(:create_history_member).in_same_layer - - permission(:layer_and_below_full). - may(:create_history_member).in_same_layer_or_visible_below + permission(:layer_and_below_full).may(:create_history_member).in_same_layer_or_visible_below permission(:layer_and_below_full). may(:create, :create_in_subgroup, :update, :destroy). diff --git a/app/controllers/song_counts_controller.rb b/app/controllers/song_counts_controller.rb index 6e7f5615..ae0a24b6 100644 --- a/app/controllers/song_counts_controller.rb +++ b/app/controllers/song_counts_controller.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2018, Schweizer Blasmusikverband. This file is part of +# Copyright (c) 2012-2020, Schweizer Blasmusikverband. This file is part of # hitobito_sbv and licensed under the Affero General Public License version 3 # or later. See the COPYING file at the top-level directory or at # https://github.com/hitobito/hitobito_sbv. @@ -26,8 +26,7 @@ def index private - def redirection_target - end + def redirection_target; end def verein? @group.is_a?(Group::Verein) @@ -35,9 +34,8 @@ def verein? def render_tabular_in_background(format) target = verein? ? group_concerts_path(@group) : group_song_censuses_path(@group) - with_async_download_cookie(format, export_filename(format), { - redirection_target: target - }) do |filename| + with_async_download_cookie(format, export_filename(format), + redirection_target: target) do |filename| Export::SongCountsExportJob.new(format, current_person.id, parent.id, @@ -46,7 +44,7 @@ def render_tabular_in_background(format) end end - def export_filename(format) + def export_filename(_format) str = SongCount.model_name.human if verein? str << "-#{@group.name.tr(' ', '_').underscore}" diff --git a/app/jobs/export/song_counts_export_job.rb b/app/jobs/export/song_counts_export_job.rb index 462df999..89d49cd8 100644 --- a/app/jobs/export/song_counts_export_job.rb +++ b/app/jobs/export/song_counts_export_job.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 -# # Copyright (c) 2019, Schweizer Blasmusikverband. This file is part of # hitobito_sbv and licensed under the Affero General Public License version 3 # or later. See the COPYING file at the top-level directory or at diff --git a/app/models/role/musikkommission_praesident.rb b/app/models/role/musikkommission_praesident.rb index 4464a122..fecc8e5c 100644 --- a/app/models/role/musikkommission_praesident.rb +++ b/app/models/role/musikkommission_praesident.rb @@ -19,12 +19,6 @@ # deleted_at :datetime # - -# Copyright (c) 2012-2013, Puzzle ITC GmbH. This file is part of -# hitobito_generic and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory or at -# https://github.com/hitobito/hitobito_generic. - class Role::MusikkommissionPraesident < Role self.permissions = [:layer_read, :group_and_below_full] end