factory_bot_rails: Issues with custom error message translations

We have a model class in rails with the following validation:

  validates :items, length: {
    minimum: 1, message: I18n.t('items.one_required')
  }

This works fine in version 5.0.1, but in 5.0.2 there’s a translation missing: en.items.one_required in the errors collection. Not sure why factory_bot would affect the i18n class but it appears to.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 21

Commits related to this issue

Most upvoted comments

I have an idea about how to fix this. I will work on it a bit today and then either make a PR or post here what I have learned so far.