rubocop-factory_bot icon indicating copy to clipboard operation
rubocop-factory_bot copied to clipboard

Autocorrect for FactoryBot/IdSequence is NOT SAFE when ids are not generated automatically

Open kyori19 opened this issue 1 year ago • 1 comments

  • Related
    • https://github.com/rubocop/rubocop-factory_bot/pull/52#issuecomment-1774662427
    • https://github.com/thoughtbot/factory_bot_rails/issues/438

Removing sequence(:id) automatically breaks the factory, not only for non-database POROs, but also DB models with id is not generated. According to the issue https://github.com/thoughtbot/factory_bot_rails/issues/438, such models exist on some applications. Thus, I think FactoryBot/IdSequence should not be marked as SAFE.

kyori19 avatar Oct 19 '24 07:10 kyori19