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

Feature/bets #3

Merged
merged 21 commits into from
Aug 26, 2020
Merged

Feature/bets #3

merged 21 commits into from
Aug 26, 2020

Conversation

hawkins
Copy link
Owner

@hawkins hawkins commented Aug 8, 2020

a few bugs to shake out, but functionally, bets can be placed and paid out

@todo
Copy link

todo bot commented Aug 8, 2020

Validation

# TODO: Validation
belongs_to :room
end


This comment was generated by todo based on a TODO comment in 3f95720 in #3. cc @hawkins.

@todo
Copy link

todo bot commented Aug 8, 2020

Editing actions?

resources :actions, only: [:create, :destroy] # TODO: Editing actions?
resources :bets, only: [:create, :destroy]
end
get 'login', to: 'sessions#new'
post 'login', to: 'sessions#create'
get 'welcome', to: 'sessions#welcome'


This comment was generated by todo based on a TODO comment in 3f95720 in #3. cc @hawkins.

@hawkins
Copy link
Owner Author

hawkins commented Aug 8, 2020

Still to-do:

  • debit users
  • validate a user can afford to place these bets
  • provide feedback that bets were placed successfully (show bets down below wager table?
  • show potential gains and losses
  • for extra brownie points, calculate the combined odds of winning all or no bets
  • allow host to lock the bets
  • check if bets are locked in validation logic
  • if bets are locked, render a different view that just shows the bets the user has placed and wagers they didn't take all in one view

cointoss/app/controllers/bets_controller.rb Outdated Show resolved Hide resolved
<td style="text-align:left" class="big"><%= action.description %></td>
<td style="text-align:left" class="small"><%= action.odds %></td>

<td style="text-align:left" class="small"><%= button_to "Begone Thot", {controller: :actions, action: :destroy, room_id: @room.id, id: action.id}, method: :delete %></td>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Begone Thot"?? Really?? I expect a certain level of professionalism from my employees and this is not it.

@todo
Copy link

todo bot commented Aug 9, 2020

Display errors such as leaving a room you own or leaving while in progress-->

<!--TODO: Display errors such as leaving a room you own or leaving while in progress-->
<%# unless @rooms.nil? %>
<%# @rooms.errors.full_messages.each do |error| %>
<!-- <div class="alert alert-danger" role="alert">-->
<%#= error %>
<!-- </div>-->


This comment was generated by todo based on a TODO comment in d1cd3d1 in #3. cc @hawkins.

@todo
Copy link

todo bot commented Aug 9, 2020

Show error for invalid bet here

# TODO: Show error for invalid bet here
render 'rooms/show'
return
end
end


This comment was generated by todo based on a TODO comment in ea21119 in #3. cc @hawkins.

@todo
Copy link

todo bot commented Aug 9, 2020

Notify users of their results

# TODO: Notify users of their results
end
end
@room.bets.delete_all


This comment was generated by todo based on a TODO comment in ea21119 in #3. cc @hawkins.

Repository owner deleted a comment from todo bot Aug 9, 2020
Repository owner deleted a comment from todo bot Aug 9, 2020
Repository owner deleted a comment from todo bot Aug 9, 2020
Repository owner deleted a comment from todo bot Aug 9, 2020
Repository owner deleted a comment from todo bot Aug 9, 2020
Repository owner deleted a comment from todo bot Aug 9, 2020
@hawkins hawkins temporarily deployed to cointoss-sim August 11, 2020 12:24 Inactive
@todo
Copy link

todo bot commented Aug 26, 2020

Display errors such as leaving a room you own or leaving while in progress-->

<!--TODO: Display errors such as leaving a room you own or leaving while in progress-->
<% unless @rooms.nil? %>
<% @rooms.each do |room|%>
<% room.errors.full_messages.each do |error| %>
<div class="alert alert-danger" role="alert">
<%= error %>


This comment was generated by todo based on a TODO comment in b127aae in #3. cc @hawkins.

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

Successfully merging this pull request may close these issues.

2 participants