Ruby 3 compatibility
还没有人认领这个 Issue。
评估
调研方向
首先比较 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 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DatabaseCleaner/database_cleaner 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 67/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 35/100
DatabaseCleaner/database_cleaner#717 · 5 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
DatabaseCleaner/database_cleaner#716 · 2 条评论 ·
查看 DatabaseCleaner/database_cleaner 的全部 Issue
相似的 Issue
-
bug: "Conversation information" accordion renders blank with 0px height when conversation has no attributes可能已有人在做 @gihovani 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
sclorg/s2i-ruby-container#660 · 1 条评论 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 86/100
bridgetownrb/bridgetown#1130 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
hlascelles/que-scheduler#611 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
rapid7/metasploit-framework#22008 ·
维护者通常 2 天内回复