Skip to content

Ensure merge doesn't try to set missing fields to nil #24

@venkatd

Description

@venkatd

The following code:

    merge({Turtle.Payments.Models.PaymentIntent, e.payment_intent_id},
      status: :processing,
      amount: e.amount,
      payment_method_id: e.payment_method_id,
      payment_method_type: String.to_atom(e.payment_method_type),
      payment_method_brand: e.payment_method_brand,
      payment_method_last4: e.payment_method_last4
    )

Fails in my codebase because it's not passing along the created_at field. It's trying to set the created_at to null but that probably means there's a bug in which missing fields in the struct are mistakenly set.

I need to write a test case to reproduce this behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions