# 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