forked from External/greenlight
Home rooms are created for all users with role if can_create_rooms is enabled (#1694)
This commit is contained in:
@ -198,6 +198,11 @@ class User < ApplicationRecord
|
||||
User.includes(:role).where.not(roles: { name: role })
|
||||
end
|
||||
|
||||
def create_home_room
|
||||
room = Room.create!(owner: self, name: I18n.t("home_room"))
|
||||
update_attributes(main_room: room)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Destory a users rooms when they are removed.
|
||||
@ -227,11 +232,6 @@ class User < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def create_home_room
|
||||
room = Room.create!(owner: self, name: I18n.t("home_room"))
|
||||
update_attributes(main_room: room)
|
||||
end
|
||||
|
||||
def role_provider
|
||||
Rails.configuration.loadbalanced_configuration ? provider : "greenlight"
|
||||
end
|
||||
|
Reference in New Issue
Block a user