Skip to content

Commit

Permalink
Modified ReedemRequest Model for delivering redemption mails to user (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BandanaPandey authored and sethu committed Aug 24, 2016
1 parent 4d68b23 commit 1bedd31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/mailers/redeem_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def redeem_request(request)
@points = request.points

mail(to: @user.email, subject: "[CODECURIOSITY] #{@points} points redemption request")
notify_admin(request)
end

def notify_admin(request)
Expand Down
3 changes: 2 additions & 1 deletion app/models/redeem_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RedeemRequest
field :comment, type: String

belongs_to :user
has_one :transaction
has_one :transaction, :dependent => :destroy

index({ commit_date: -1 })

Expand All @@ -29,6 +29,7 @@ class RedeemRequest
after_create do |r|
r.create_redeem_transaction
RedeemMailer.redeem_request(r).deliver_later
RedeemMailer.notify_admin(r).deliver_later
end

after_save :send_notification
Expand Down

0 comments on commit 1bedd31

Please sign in to comment.