Skip to content

Commit cb8362a

Browse files
committed
only set fields if vendor is actually changing
Fixes #45
1 parent 438a07c commit cb8362a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/skr/models/Payment.coffee

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class Skr.Models.Payment extends Skr.Models.Base
5050
#{@name} #{metadata}"
5151

5252
onSetVendor: ->
53-
return unless @vendor and @vendor.isPersistent()
53+
return if not @vendor.isPersistent() or
54+
@vendor.id is this.previous('vendor')?.id
55+
5456
@name ||= @vendor.billing_address.name if @vendor.billing_address.name?
5557
@vendor.withAssociations(['billing_address']).then (v) =>
5658
@address = v.billing_address.toString()

0 commit comments

Comments
 (0)