我在根据用户名或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)
我真的很感激任何帮助