Verified Commit 3142fd93 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider
Browse files

chore(linting): non todo fix Metrics/AbcSize cop

parent b0c3ced9
......@@ -31,9 +31,44 @@ Rails/RefuteMethods:
Metrics/AbcSize:
Exclude:
- test/**/*
- app/controllers/application_controller.rb
- app/controllers/assignments_controller.rb
- app/controllers/billing_expenses_controller.rb
- app/controllers/clients_controller.rb
- app/controllers/departments_controller.rb
- app/controllers/feedbacks_controller.rb
- app/controllers/group_assignments_controller.rb
- app/controllers/group_offers_controller.rb
- app/controllers/hours_controller.rb
- app/controllers/semester_process_volunteers_controller.rb
- app/controllers/semester_processes_controller.rb
- app/controllers/users_controller.rb
- app/controllers/volunteers_controller.rb
- app/inputs/date_range_picker_input.rb
- app/inputs/date_year_range_picker_input.rb
- app/models/certificate.rb
- app/models/performance_report.rb
- app/models/reminder_mailing_volunteer.rb
- app/models/semester_process_volunteer.rb
- config/**/*
- db/seeds.rb
Max: 25
- lib/access_import/**/*
- test/**/*
IgnoredMethods:
- dates_semester_start
- boolean_toggler_filter_dropdown
- custom_filter_dropdown_filters
- td_truncate_content_modal
- validate_group_assignment_or_assignment_present
- document_js_nodes
- take_responsibility
- build_nested_objects
- handle_semester_feedback_quote
- set_journaled
- last_submitted_hours_and_feedbacks
- selected_billing_semester
- in_feedbackable?
Metrics/ClassLength:
Exclude:
- test/**/*
......@@ -53,6 +88,7 @@ Metrics/BlockLength:
- draw # for routes
- define # for FactoryBot
- factory
- test
Lint/RaiseException:
Enabled: true
......
This diff is collapsed.
......@@ -33,19 +33,25 @@ class TrialPeriod < ApplicationRecord
unverified? && end_date < Date.current
end
def verify!(user)
journal = Journal.new(user: user,
journalable: mission.volunteer,
category: :feedback,
title: "Probezeit Quittiert von #{user.profile.full_name} <#{user.email}>",
body: "Einsatz: #{mission.to_label}")
def verify!(verifier)
journal = journal_for_verify(verifier)
journal.assignment = mission if mission.class.name == 'Assignment'
journal.save!
update!(verified_at: Time.zone.now, verified_by: user, notes: nil)
update!(verified_at: Time.zone.now, verified_by: verifier, notes: nil)
end
# allow ransack to use defined scopes
def self.ransackable_scopes(_auth_object = nil)
['not_verified', 'verified', 'trial_period_running', 'trial_period_overdue']
end
private
def journal_for_verify(verifier)
Journal.new(user: verifier,
journalable: mission.volunteer,
category: :feedback,
title: "Probezeit Quittiert von #{verifier.profile.full_name} <#{verifier.email}>",
body: "Einsatz: #{mission.to_label}")
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment