Skip to content

Commit

Permalink
item
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Dec 23, 2024
1 parent 612d8c4 commit d4f39f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/trade/model/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ module Model::Item
)

after_initialize :init_uuid, if: :new_record?
#after_initialize :sync_from_good, if: -> { new_record? && good_id.present? }
before_validation :sync_from_good, if: -> { good_id.present? && good_id_changed? }
before_validation :compute_amount, if: -> { (changes.keys & ['number', 'single_price']).present? }
before_validation :add_promotes, if: :new_record?
before_validation :sync_from_current_cart, if: -> { current_cart && current_cart_id_changed? }
before_validation :init_delivery, if: -> { (changes.keys & ['user_id', 'member_id', 'organ_id']).present? }
before_validation :init_organ_delivery, if: -> { (changes.keys & ['member_organ_id']).present? }
before_save :compute_amount, if: -> { (changes.keys & ['number', 'single_price']).present? }
before_save :set_wallet_amount, if: -> { (changes.keys & ['number', 'single_price']).present? }
before_save :sync_from_order, if: -> { order_id.present? && order_id_changed? }
before_update :reset_promotes, if: -> { (changes.keys & PROMOTE_COLUMNS).present? }
Expand Down

0 comments on commit d4f39f9

Please sign in to comment.