Files
once-campfire/app/models/rooms/open.rb
Kevin McConnell df76a227dc Hello world
First open source release of Campfire 🎉
2025-08-21 09:31:59 +01:00

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