Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canceling a meal #5

Closed
3 tasks done
Reprazent opened this issue May 26, 2015 · 2 comments
Closed
3 tasks done

Canceling a meal #5

Reprazent opened this issue May 26, 2015 · 2 comments

Comments

@Reprazent
Copy link
Owner

Reprazent commented May 26, 2015

Meals should become canceled:

  • Save a canceled_at date
  • Recalculate the balance for all users
  • Delete wrongly created users (if the user has no mealz left after deleting)
m.users.each do |eater|
  eater.balance -= m.amount if eater == m.payed_by
  eater.balance += m.amount / m.users.count
  eater.save!
end

This could go in a new seperate MealDestroyer

@pjaspers
Copy link
Collaborator

pjaspers commented Feb 2, 2017

Thanks @lewis-fidlers!

@pjaspers pjaspers closed this as completed Feb 2, 2017
@lewis-fidlers
Copy link
Collaborator

h5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants