Ruby 3 compatibility
まだ誰も着手していません。
評価
調査の方向性
まず、lib/database_cleaner/cleaner.rb と、database_cleaner-active_record/lib/database_cleaner/active_record/truncation.rb および database_cleaner-redis/lib/database_cleaner/redis/deletion.rb にあるオプション処理のエントリポイントを比較します。既存の PostgreSQL、MySQL、SQLite の specs を実行し、続いて Ruby 3 で報告されている strategy= 呼び出しを確認します。sub-gems が一貫してオプションを処理し、互換性の問題が合格する specs でカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Have there been any efforts already on getting this gem ready for Ruby 3?
this kind of magic: https://github.com/DatabaseCleaner/database_cleaner/blob/master/lib/database_cleaner/cleaner.rb#L43
def strategy=(args)
strategy, *strategy_args = args
won't work in Ruby 3, I've seen quite some usage of this pattern.
Also, the redis and the active_record sub-gems use kwargs vs. options-hashes differently, see:
class Truncation < Base
def initialize(opts={})
class Deletion < Strategy
def initialize only: [], except: []
which will make it harder to upgrade the database gem family.
So probably as a first step, we should harmonize all sub-gems to use the same way of passing options around, either as a hash or using keyword arguments. From there we can tinker further.
I've tried it quickly locally and run into too many issues to push a draft PR. I might find more time on one of the next weekends though. -> hence the question, if there is already any PR/fork that started working on Ruby 3 compatibility.
As always, thanks for the gems 🙂
=> Specs are passing for Postgresql, MySQL, SQLlite locally, however, when I use
DatabaseCleaner.strategy = :deletion, { except: %i[not_you also_not_you blubb] }
in one of my projects, strategy= fails with the Ruby 3 kwargs/hash error.
- 主要言語
- Ruby
- スター
- 3k
- フォーク
- 484
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DatabaseCleaner/database_cleaner のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
-
Cleaning of dev DBオープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
Cannot truncate a table referenced in a foreign key constraint (ActiveRecord::StatementInvalid)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
DatabaseCleaner/database_cleaner#717 · コメント 5 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
DatabaseCleaner/database_cleaner#716 · コメント 2 件 ·
DatabaseCleaner/database_cleaner の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Homebrew/homebrew-cask#293134 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
notch8/iiif_print#430 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
ActionText::Content#to_markdown: <br> in a table cell and empty <tr> produce malformed Markdown tables対応中かも @azmi2409 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信