# frozen_string_literal: true module BusinessFlow # Provides compatibility for ActiveSupport/Model 4.x through 7.x module Compat unless Module.instance_methods.include?(:module_parents) # ActiveSupport 5 removed #parents in favor of #module_parents. class ::Module def module_parents parents end end end unless ActiveModel::Errors.instance_methods.include?(:merge!) # ActiveModel 5 added details (which we do not use here) and #merge! # :reek:MissingSafeMethod Look it's the API. module ::ActiveModel # Amend the errors class with a convenience method. class Errors def merge!(other) other.each do |attribute, message| self[attribute] << message end end end end end end end