Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable callbacks in future_role #60

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions app/models/jubla/future_role.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Copyright (c) 2012-2023, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.
#
module Jubla::FutureRole
extend ActiveSupport::Concern

included do
skip_callback :save, :after, :set_person_origins
skip_callback :destroy, :after, :set_person_origins

skip_callback :create, :after, :alumnus_manager_destroy
skip_callback :destroy, :after, :alumnus_manager_create

skip_callback :create, :after, :alumnus_manager_create_for_alumnus
skip_callback :destroy, :after, :alumnus_manager_destroy_for_alumnus
end
end

1 change: 1 addition & 0 deletions lib/hitobito_jubla/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Wagon < Rails::Engine
RoleAbility.include Jubla::RoleAbility
PersonReadables.include Jubla::PersonReadables
PersonFetchables.include Jubla::PersonFetchables
FutureRole.include Jubla::FutureRole

# load this class after all abilities have been defined
Ability.store.register Event::Course::ConditionAbility
Expand Down
Loading