docbrown/app/services/chat_channel_creation_service.rb
Ben Halpern 94e5154668
Add initial invitation framework for chat channels (#528)
* Add initial invitation framework for chat channels

* Update chat_channel specs

* Add DIY concept of accepting invite

* Add some js and fix spec

* Add full invite accept functionality

* Remove console.log from chat
2018-07-02 16:31:20 -04:00

13 lines
No EOL
286 B
Ruby

class ChatChannelCreationService
attr_accessor :user, :params
def initialize(user, params)
@user = user
@params = params
end
def create
user.chat_channels.create(channel_type: "invite_only",
channel_name: params[:channel_name], slug: params[:slug])
end
end