Rails:无法识别json类型的相等运算符

时间:2018-03-14 07:58:23

标签: ruby-on-rails postgresql activerecord

我在根据用户名或filtered plays data对某个查询进行排序user username时遇到了一些问题,我认为我已经基于Rails API /文档实现了正确的查询。

错误说: ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: could not identify an equality operator for type json

filtered_plays.
  where('plays.user_id = (:id) OR plays.user_id in (:current_friend_ids)', id: id, current_friend_ids: (user_friends + user_friend_users).pluck(:id)).
  union(friend_of_friend_plays).not_flagged.
  joins(:votes).where(votes: { user_id: id }).
  following_prioritized.includes(:user).
  references(:users).sorted_username_ascendingly.
  distinct.
  limit(25)

我真的很感激任何帮助

0 个答案:

没有答案