怎么得不到current_user

How not get current_user

为了得到这种情况的用户,我很头疼:

对话模型:

has_many :conversation_participants, :dependent => :destroy
  has_many :users,
    :through => :conversation_participants
  has_many :messages, :dependent => :destroy
  has_one :display_message,
    :class_name => 'Message',
    :order => 'created_at DESC'

  def participants(options={})
    if options[:not].is_a? User
      users - [options[:not]]
    else
      users
    end
  end

和conversation_participants:

belongs_to :user
belongs_to :conversation
attr_accessible :user_id

在对话助手上:

 def self_or_other
    @conversation.conversation_participants.find_by_user_id(:not => current_user)
  end

拜托,有人可以告诉我如何让其他用户进入 conversation_participants 模型吗?

我相信如下:

@conversation.conversation_participants.where.not(user_id: current_user.id).first