私はそのようなモデルを持っています
class Ads::Posting < ActiveRecord:Base
has_one :child, class_name: 'Ads::Posting', foreign_key: :posting_id
belongs_to :parent, class_name: 'Ads::Posting', foreign_key: :posting_id
end
子なしですべての投稿を取得するスコープを作成する必要があります。それを行う方法はありますか?