Skip to content

Commit

Permalink
メソッド名を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Takuya-Sakai91 committed Dec 20, 2023
1 parent e10c4a7 commit a62971b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/hibernation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create
destroy_subscription!
notify_to_chat
notify_to_mentors_and_admins
current_user.organizers_delete_and_assign_new
current_user.delete_and_assign_new_organizer
logout
redirect_to hibernation_path
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/retirement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create
current_user.retired_on = Date.current
if current_user.save(context: :retirement)
user = current_user
current_user.organizers_delete_and_assign_new
current_user.delete_and_assign_new_organizer
Newspaper.publish(:retirement_create, user)
begin
UserMailer.retire(user).deliver_now
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def become_watcher!(watchable)
watches.find_or_create_by!(watchable:)
end

def organizers_delete_and_assign_new
def delete_and_assign_new_organizer
organizers.each(&:delete_and_assign_new)
end

Expand Down
4 changes: 2 additions & 2 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,11 @@ class UserTest < ActiveSupport::TestCase
assert_empty User.users_role(not_scope_name, allowed_targets: allowed_targets)
end

test '#organizers_delete_and_assign_new' do
test '#delete_and_assign_new_organizer' do
user = users(:hajime)

assert_changes -> { Organizer.where(user: user).exists? }, from: true, to: false do
user.organizers_delete_and_assign_new
user.delete_and_assign_new_organizer
end
end
end

0 comments on commit a62971b

Please sign in to comment.