Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Extract organiser grant/revoke diffing from Admin::WorkshopsController

Đang mở
#2,941 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rails, ruby
Lĩnh vực
backend

Hướng nghiên cứu

Read Admin::WorkshopsController and the existing app/services/ service objects to follow project conventions. Trace create and update, including assign_organisers_or_default and update_workshop_details, then run the existing admin workshop controller specs. Done means role changes behave identically for create/update, including the default-to-chapter-organisers path, and the controller no longer contains role-diffing logic.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

refactoring tech debt

Parent: #2938

Problem

Admin::WorkshopsController mutates Member roles directly from private controller methods, on both create (assign_organisers_or_default) and update (update_workshop_details):

def grant_organiser_access(organiser_ids = [])
  organiser_ids.each { |id| Member.find(id).add_role(:organiser, @workshop) }
end

def revoke_organiser_access(organiser_ids)
  (@workshop.organisers.pluck(:id).map(&:to_s) - organiser_ids).each do |id|
    Member.find(id).revoke(:organiser, @workshop)
  end
end

Diffing desired vs current organisers and mutating roles is application-layer orchestration, not HTTP coordination.

Proposed change

  • Extract the diff + grant/revoke into a service object under app/services/ (follow the existing *_service conventions there; naming up to the implementer).
  • The controller calls it from create/update; the default-to-chapter-organisers branch moves with it.

Acceptance

  • Admin::WorkshopsController no longer contains role-diffing logic.
  • Organiser membership changes identically after create/update, including the default-to-chapter-organisers path.
  • Existing admin workshop controller specs pass.
Ngôn ngữ chính
Ruby
Star
104
Fork
205
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codebar/planner

Tất cả issue của codebar/planner

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.