Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Pagination, sorting and filtering of related resources no longer work properly

オープン
#1,117 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ruby

調査の方向性

RelationshipBuilder から始め、relationship_name と associated_records_method_name の define_on_resource ブロックを比較します。オーバーライドされた relationship について records_for_comments を追跡し、そのカスタムメソッドを使用した場合でも、ソート、フィルタリング、ページネーションが引き続き適用されることを確認します。issue にはテストファイルへの言及がないため、変更を加える前に、関連する relationship の動作テストを特定してください。

索引モデルが issue の本文から書いたものです。

説明

After upgrading to 0.9.0, when records for a relationship is overridden in the resource, pagination, sorting and filtering no longer works. Example, we have a UserResource and it has a has_many :comments relationship and on the resource, we override the method like:

def records_for_comments(_options = {})
  # do some custom stuff here
end

After debugging, I can see that this is because from the older versions, in RelationshipBuilder, the logic where the records are sorted, filtered and paginated in the block:

define_on_resource relationship_name do |options = {}|
  # . . .
end

are moved to this block:

define_on_resource associated_records_method_name do |options = {}|
  # . . .
end
主要言語
Ruby
スター
2.3k
フォーク
546
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JSONAPI-Resources/jsonapi-resources のほかの issue

JSONAPI-Resources/jsonapi-resources の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。