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|
      s << "<option value='#{user.id}' 
data-img-src='#{attachment_url(@user, user.email, :profile_avatar, 
:fill, 30, 30)}'>#{user.username}</option>"
    end
    s.html_safe
  end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/0001828faa8474999b7ba6a7e95d66a7%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to