I've got two models with optional relations has_many - belongs_to, like below:
class Journey < ApplicationRecord
has_many :activities, dependent: :destroy, foreign_key: 'cms_journey_id'
end
class Activity < ApplicationRecord
belongs_to :journey, optional: true, foreign_key: 'cms_journey_id'
end
As you see the relation is based on non-standard foregin_key name (both models are linked with each other by record called cms_journey_id). After I added foreign_key: 'cms_journey_id' I'm getting Rubocop error in both models:
Rails/InverseOf: Specify an `:inverse_of` option