Ireisme/GameTracker — pull request #2 by bpruitt-goddard (2014-11-05 05:07:16+00:00)
Title: Add basic Session page view

Includes game name, played date, and list of players (and their placing).

Can view at `/sessions` url.

Working on the create page next. In the meantime, here is some sample code to insert 2 sessions with 2 players each (assumes you have 2 players and 2 games with ids 1 and 2).

--insert session
INSERT INTO sessions (played, notes, game_id, created_at, updated_at) VALUES
('2014-11-04', 'notes went here', 1, '2014-11-04', '2014-11-04');
--player 1 came in first and on team 2
INSERT INTO session_players (score, "placing", team_number, player_id, session_id, created_at, updated_at) VALUES
(11, 1, 2, 1, 1, '2014-11-04', '2014-11-04');
--player 2 came in second and on team 2
INSERT INTO session_players (score, "placing", team_number, player_id, session_id, created_at, updated_at) VALUES
(11, 2, 2, 2, 1, '2014-11-04', '2014-11-04');
--insert session
INSERT INTO sessions (played, notes, game_id, created_at, updated_at) VALUES
('2014-11-01', 'more test notes?', 2, '2014-11-01', '2014-11-01');
--player 1 came in second and on team 1
INSERT INTO session_players (score, "placing", team_number, player_id, session_id, created_at, updated_at) VALUES
(11, 1, 2, 1, 2, '2014-11-01', '2014-11-01');
--player 2 came in first and on team 1
INSERT INTO session_players (score, "placing", team_number, player_id, session_id, created_at, updated_at) VALUES
(11, 2, 2, 2, 2, '2014-11-01', '2014-11-01');