The InvalidField error is triggered when using a reserved keyword for a field in Mongoid. This will trigger even if the field name is lacking an `=` or `?` at the end. For example if one named a field `invalid`, the error would be triggered for overriding `invalid?`. The problem is, the given error is as follows:
message: Defining a field named 'invalid?' is not allowed. summary: Defining this field would override the method 'invalid?', which would cause issues with expectations around the original method and cause extremely hard to debug issues. The original method was defined in: Object: ActiveModel::Validations File: /Users/neil.shweky/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/activemodel-6.0.3.2/lib/active_model/validations.rb Line: 373 resolution: Use Mongoid.destructive_fields to see what names are not allowed, and don't use these names. These include names that also conflict with core Ruby methods on Object, Module, Enumerable, or included gems that inject methods into these or Mongoid internals.
The error points to a field name definition `invalid?` whereas the name of the field we defined was `invalid`.