0
я буду ломать голову, чтобы заставить пользователя этой ситуации:Как не получить 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
, пожалуйста, кто-то может очистить меня, как получить другого пользователя в модели chat_participants?
большое спасибо @ Малъ-Скрылевъ но на бревнах показывает: неверное число аргументов (0 для 1+) –
@Danielfir, какой метод? Просьба указать часть трассировки, а также код вокруг места ошибки –