Привет.
Не могу понять, что не так.
scope :between, -> (sender_id, recipient_id) do
where(“(conversations.sender_id = ? AND conversations.recipient_id = ? ) OR
(conversations.sender_id = ? AND conversations.recipient_id = ? )”,
sender_id, recipient_id, recipient_id, sender_id)
end
Погуглил примеры - вроде все правильно, но ругается кучей ошибок на синтаксис.
/home/dartnyan/Projects/instagram_app/app/models/conversation.rb:10: syntax error, unexpected '?' ...“(conversations.sender_id = ? AND conversations.recipient_... ... ^ /home/dartnyan/Projects/instagram_app/app/models/conversation.rb:10: syntax error, unexpected '?' ... conversations.recipient_id = ? ) OR ... ^ /home/dartnyan/Projects/instagram_app/app/models/conversation.rb:11: syntax error, unexpected '?' ... (conversations.sender_id = ? AND conversations.recipient_... ... ^ /home/dartnyan/Projects/instagram_app/app/models/conversation.rb:11: syntax error, unexpected '?' ... conversations.recipient_id = ? )”, ... ^ /home/dartnyan/Projects/instagram_app/app/models/conversation.rb:12: syntax error, unexpected ')', expecting '='
Rails 5.0, Ruby 2.3