mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-03-20 04:59:03 +09:00
10 lines
341 B
Ruby
10 lines
341 B
Ruby
# Rooms open to all users on the account. When a new user is added to the account, they're automatically granted membership.
|
|
class Rooms::Open < Room
|
|
after_save_commit :grant_access_to_all_users
|
|
|
|
private
|
|
def grant_access_to_all_users
|
|
memberships.grant_to(User.active) if type_previously_changed?(to: "Rooms::Open")
|
|
end
|
|
end
|