私のモデルには次のようなものがあります。
class User < ActiveRecord::Model
has_many :followers, :through => :as_followed_followings, :class_name => "User", :foreign_key => "follower_id", :uniq => true
...
def self.search(params)
tire.search(load: true, page: params[:page], per_page: params[:per]) do
end
end
end
ユーザーのフォロワー数で並べ替えられたユーザーの配列を返したいと思います。
count プロパティでネストされたオブジェクトを検索するためのマッピングとインデックスを定義する正しい方法は何ですか?
読んでくれてありがとう。