Skip to content

Commit

Permalink
reverted #855
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Dec 6, 2023
1 parent 45b6323 commit b9dd047
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/masoniteorm/models/Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,19 +710,9 @@ def update_or_create(cls, wheres, updates):
total.update(updates)
total.update(wheres)
if not record:
# if we don't return fresh, we don't get the primary_key that has been used,
# and we can't call it from outside the function lest we get a QueryBuilder.
#
# Without this we are reduced to performing a DIY update_or_create, e.g.:
# ebay_order = EbayOrder.where({'order_id': d['order_id']}).first()
# if not ebay_order:
# ebay_order = EbayOrder.create(d).fresh()
# else:
# ebay_order.save()
return self.create(total, id_key=cls.get_primary_key()).fresh()

rv = self.where(wheres).update(total)
return self.where(wheres).first()
return self.where(wheres).update(total)

def relations_to_dict(self):
"""Converts a models relationships to a dictionary
Expand Down

0 comments on commit b9dd047

Please sign in to comment.