Skip to content

Commit fd562ac

Browse files
author
Ashish Kumar Rudra
committed
bug fix
1 parent 306582a commit fd562ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/models/guru.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def add_deal(username, deal_params)
1919

2020
deal = Deal.find_or_create_by!({ deal_uuid: deal_uuid, permalink: permalink })
2121
guru_deal_mapping = GuruDeal.find_or_create_by!({ guru: guru, deal: deal })
22+
23+
if deal_params[:is_cover]
24+
GuruDeal.where({ guru: guru }).update_all({ is_cover: false })
25+
end
2226
guru_deal_mapping.update(deal_params.except(:uri))
2327

2428
guru.reload

0 commit comments

Comments
 (0)