Skip to content

Commit

Permalink
added the second rake task, and fixed a couple views to support the
Browse files Browse the repository at this point in the history
end of the draft
  • Loading branch information
James Trowbridge committed May 6, 2010
1 parent d038c6e commit 65b4235
Show file tree
Hide file tree
Showing 9 changed files with 6,526 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/controllers/picks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class PicksController < ApplicationController

def home
@previous_picks = []
@pick = Pick.current
@end_of_draft = @pick.nil?
@previous_picks = Pick.previous_picks
end

Expand Down
30 changes: 19 additions & 11 deletions app/views/picks/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<h2>Welcome to the Chase Mock Draft</h2>
<% if logged_in? %>
<h1>If you are an admin and would like to perform the draft click <%= link_to "here", pick_path(@pick) %><h1>
<% end %>
<h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>

The Previous 3 picks have been
<% @previous_picks.each do |pick| %>
<h2><%= pick.team.name %></h2>
Who drafted <li><%= pick.player.name%>, <%=pick.player.position%></li>

<% unless @end_of_draft %>

<% if logged_in? %>
<h1>If you are an admin and would like to perform the draft click <%= link_to "here", pick_path(@pick) %><h1>
<% end %>

<h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>

The Previous 3 picks have been
<% @previous_picks.each do |pick| %>
<h2><%= pick.team.name %></h2>
Who drafted <li><%= pick.player.name%>, <%=pick.player.position%></li>
<% end %>

<h2>The next pick will be</h2>
<li><%= Pick.next.team.name %></li>
<h2>The next pick will be</h2>
<li><%= Pick.next.team.name %></li>

<% else %>
<h2> The draft is over! </h2>
<% end %>

<h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
<h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
Expand Down
2 changes: 1 addition & 1 deletion app/views/picks/results.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% @draft_results.each do |result| %>
Round <%= result.round %>
Pick <%= result.pick_number %>
<li><%= result.player.name %> , <%= result.player.position %></li>
<li><%= result.player.name %> , <%= result.player.position %></li><br>
<% end %>
Binary file modified db/development.sqlite3
Binary file not shown.
Binary file modified db/test.sqlite3
Binary file not shown.
9 changes: 9 additions & 0 deletions lib/tasks/simulate_draft.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
desc "Simulate the draft order"
task :simulate_draft => :environment do
picks = Pick.find(:all)
picks.sort_by {|pick| pick['pick_number']}
picks.each do |pick|
pick.team.kiper_draft
end

end
6,027 changes: 6,027 additions & 0 deletions log/development.log

Large diffs are not rendered by default.

439 changes: 439 additions & 0 deletions log/test.log

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions typescript
Original file line number Diff line number Diff line change
Expand Up @@ -3087,4 +3087,34 @@ rake tmp:sockets:clear
-> 0.0089s
(master)~/dev/nfl_draft/spec/models ➔ rake db:reset-Dgit push origin mastercommitadd .spec team_spec.rbgit add .spec pick_spec.rblayer_spec.rbteam_spec.rbpick_spec.rbrake db:draft_informationmigratedraft_information
(in /Users/jamestrowbridge/dev/nfl_draft)
(master)~/dev/nfl_draft/spec/models ➔ git add .
(master)~/dev/nfl_draft/spec/models ➔ git commit
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: ../../app/controllers/picks_controller.rb
# modified: ../../app/controllers/players_controller.rb
# modified: ../../app/models/pick.rb
# modified: ../../app/models/player.rb
# modified: ../../app/views/picks/home.html.erb
# modified: ../../app/views/players/index.html.erb
# deleted: ../../app/views/teams/_form.html.erb
# deleted: ../../app/views/teams/edit.html.erb
# modified: ../../app/views/teams/index.html.erb
# deleted: ../../app/views/teams/new.html.erb
# modified: ../../config/routes.rb
# modified: ../../db/development.sqlite3
# modified: ../../log/development.log
# modified: ../../log/test.log
# modified: ../../public/stylesheets/application.css
# modified: ../../typescript
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../../app/views/picks/results.html.erb
# ../../app/views/players/undrafted.html.erb
no changes added to commit (use "git add" and/or "git commit -a")
(master)~/dev/nfl_draft/spec/models ➔
Expand Down

0 comments on commit 65b4235

Please sign in to comment.