def data_attributes_exist
      return unless data_attributes
      attr_names = data_class.try(:attribute_names) || []
      unknown_attrs = data_attributes.select do |a|
        (a.class == Symbol || a.class == String) && !attr_names.include?(a.to_s)
      end
      return if unknown_attrs.count == 0

      errors.add(:data_attributes, "must be attributes on the model class " \
                 "(unrecognized: #{unknown_attrs.join(', ')})")
    end
def data_attributes_exist
      return unless data_attributes
      attr_names = data_class.try(:attribute_names) || []
      unknown_attrs = data_attributes.select do |a|
        (a.class == Symbol || a.class == String) && !attr_names.include?(a.to_s)
      end
      return if unknown_attrs.count == 0

      errors.add(:data_attributes, "must be attributes on the model class " \
                 "(unrecognized: #{unknown_attrs.join(', ')})")
    end
rubocop:disable Metrics/AbcSize