Colin Law wrote in post #1166693:
> On 15 January 2015 at 04:12, David Williams <
li...@ruby-forum.com>
> wrote:
>> These two functions below work perfectly for end to end normal user
>> interaction. But, I need help giving line 2 of the code "recipients =
>> User.where(id: params['recipients']) multiple user support. As in allow
>> User model to interact with BizUser model.
>
> What is BizUser?
>
> Colin
I got it.
def create
recipients = User.where(id: params['recipients']) ||
BizUser.where(id: params['recipients'])
conversation = current_user.send_message(recipients,
params[:message][:body], params[:message][:subject]).conversation
flash[:success] = "Message has been sent!"
redirect_to conversations_index_path(conversation)
end
def recipients_options
s = ''
users = User.all + BizUser.all; users.each do |user|
data-img-src='#{attachment_url(@user, user.email, :profile_avatar,
:fill, 30, 30)}'>#{user.username}</option>"