diff options
Diffstat (limited to 'app/services/users')
-rw-r--r-- | app/services/users/dismiss_namespace_callout_service.rb | 11 | ||||
-rw-r--r-- | app/services/users/dismiss_project_callout_service.rb | 11 | ||||
-rw-r--r-- | app/services/users/update_service.rb | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/app/services/users/dismiss_namespace_callout_service.rb b/app/services/users/dismiss_namespace_callout_service.rb new file mode 100644 index 00000000000..51261a93e20 --- /dev/null +++ b/app/services/users/dismiss_namespace_callout_service.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Users + class DismissNamespaceCalloutService < DismissCalloutService + private + + def callout + current_user.find_or_initialize_namespace_callout(params[:feature_name], params[:namespace_id]) + end + end +end diff --git a/app/services/users/dismiss_project_callout_service.rb b/app/services/users/dismiss_project_callout_service.rb new file mode 100644 index 00000000000..23549b3b194 --- /dev/null +++ b/app/services/users/dismiss_project_callout_service.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Users + class DismissProjectCalloutService < DismissCalloutService + private + + def callout + current_user.find_or_initialize_project_callout(params[:feature_name], params[:project_id]) + end + end +end diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb index c3df9b153a1..cb2711b6fee 100644 --- a/app/services/users/update_service.rb +++ b/app/services/users/update_service.rb @@ -17,7 +17,7 @@ module Users end def execute(validate: true, check_password: false, &block) - yield(@user) if block_given? + yield(@user) if block user_exists = @user.persisted? @user.user_detail # prevent assignment |