From 4afa32542e9b35971be4a801b771223743dc6eb9 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 30 Nov 2018 12:58:13 +0100 Subject: [PATCH 1/3] Change GroupScore attributes --- db/migrate/0000_create_schema.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/0000_create_schema.rb b/db/migrate/0000_create_schema.rb index fc7488b..95b8b6b 100644 --- a/db/migrate/0000_create_schema.rb +++ b/db/migrate/0000_create_schema.rb @@ -102,9 +102,9 @@ class CreateSchema < ActiveRecord::Migration[5.2] end create_table :group_scores do |t| - t.integer :score, default: 0 - t.integer :points_scored, default: 0 - t.integer :points_received, default: 0 + t.integer :group_points, default: 0 + t.integer :scored_points, default: 0 + t.integer :recieved_points, default: 0 t.belongs_to :team, index: true, foreign_key: { on_delete: :cascade }, null: false t.belongs_to :group, index: true, foreign_key: { on_delete: :cascade }, null: false From 68f9b3b2b39cc77e37a96bcf41287a6224751329 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 30 Nov 2018 13:52:25 +0100 Subject: [PATCH 2/3] Change Score to MatchScore & MatchScore score attribute to points This is done to improve the naming and therefore make things easier to understand. --- app/controllers/matches_controller.rb | 2 +- app/models/match.rb | 4 ++-- app/models/{score.rb => match_score.rb} | 2 +- app/models/team.rb | 2 +- app/serializers/match_score_serializer.rb | 7 +++++++ app/serializers/match_serializer.rb | 2 +- app/serializers/score_serializer.rb | 7 ------- app/services/match_service.rb | 8 ++++---- db/migrate/0000_create_schema.rb | 4 ++-- db/seeds.rb | 4 ++-- spec/controllers/matches_controller_spec.rb | 4 ++-- spec/factories/{scores.rb => match_scores.rb} | 4 ++-- spec/factories/matches.rb | 4 ++-- .../{score_spec.rb => match_score_spec.rb} | 4 ++-- spec/models/match_spec.rb | 16 ++++++++-------- spec/models/team_spec.rb | 2 +- spec/services/match_service_spec.rb | 4 ++-- 17 files changed, 40 insertions(+), 40 deletions(-) rename app/models/{score.rb => match_score.rb} (66%) create mode 100644 app/serializers/match_score_serializer.rb delete mode 100644 app/serializers/score_serializer.rb rename spec/factories/{scores.rb => match_scores.rb} (60%) rename spec/models/{score_spec.rb => match_score_spec.rb} (69%) diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 6dea146..5687b2f 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -3,6 +3,6 @@ class MatchesController < ApplicationController # GET /matches/1 def show - render json: Match.find(params[:id]), include: ['scores.score', 'scores.team'], status: status + render json: Match.find(params[:id]), include: ['match_scores.points', 'match_scores.team'], status: status end end diff --git a/app/models/match.rb b/app/models/match.rb index f8ede0a..0eb0c14 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -5,9 +5,9 @@ class Match < ApplicationRecord belongs_to :stage, optional: true belongs_to :group, optional: true - has_many :scores, dependent: :destroy + has_many :match_scores, dependent: :destroy - validates :scores, length: { maximum: 2 } + validates :match_scores, length: { maximum: 2 } validate :stage_xor_group diff --git a/app/models/score.rb b/app/models/match_score.rb similarity index 66% rename from app/models/score.rb rename to app/models/match_score.rb index c24c0a9..4d7f9bf 100644 --- a/app/models/score.rb +++ b/app/models/match_score.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Score < ApplicationRecord +class MatchScore < ApplicationRecord belongs_to :match belongs_to :team end diff --git a/app/models/team.rb b/app/models/team.rb index 925ce9f..f266f9c 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -3,7 +3,7 @@ class Team < ApplicationRecord belongs_to :tournament, optional: true has_many :group_scores, dependent: :destroy - has_many :scores, dependent: :destroy + has_many :match_scores, dependent: :destroy validates :name, presence: true diff --git a/app/serializers/match_score_serializer.rb b/app/serializers/match_score_serializer.rb new file mode 100644 index 0000000..f4f9987 --- /dev/null +++ b/app/serializers/match_score_serializer.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class MatchScoreSerializer < ApplicationSerializer + attributes :points + + has_one :team +end diff --git a/app/serializers/match_serializer.rb b/app/serializers/match_serializer.rb index d608775..c89e7a8 100644 --- a/app/serializers/match_serializer.rb +++ b/app/serializers/match_serializer.rb @@ -3,5 +3,5 @@ class MatchSerializer < ApplicationSerializer attributes :state - has_many :scores + has_many :match_scores end diff --git a/app/serializers/score_serializer.rb b/app/serializers/score_serializer.rb deleted file mode 100644 index 08ef59d..0000000 --- a/app/serializers/score_serializer.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class ScoreSerializer < ApplicationSerializer - attributes :score - - has_one :team -end diff --git a/app/services/match_service.rb b/app/services/match_service.rb index ca4bce9..25b590a 100644 --- a/app/services/match_service.rb +++ b/app/services/match_service.rb @@ -20,16 +20,16 @@ class MatchService i = matches.size match = Match.new state: :not_started, position: i, - scores: [ - Score.create(team: teams[2 * i]), - Score.create(team: teams[(2 * i) + 1]) + match_scores: [ + MatchScore.create(team: teams[2 * i]), + MatchScore.create(team: teams[(2 * i) + 1]) ] matches << match end until matches.size >= needed_games i = matches.size - match = Match.new state: :single_team, position: i, scores: [Score.create(team: teams[i])] + match = Match.new state: :single_team, position: i, match_scores: [MatchScore.create(team: teams[i])] matches << match end matches diff --git a/db/migrate/0000_create_schema.rb b/db/migrate/0000_create_schema.rb index 95b8b6b..600a2a2 100644 --- a/db/migrate/0000_create_schema.rb +++ b/db/migrate/0000_create_schema.rb @@ -92,8 +92,8 @@ class CreateSchema < ActiveRecord::Migration[5.2] t.timestamps end - create_table :scores do |t| - t.integer :score, default: 0 + create_table :match_scores do |t| + t.integer :points, default: 0 t.belongs_to :match, index: true, null: false, foreign_key: { on_delete: :cascade } t.belongs_to :team, index: true, null: false, foreign_key: { on_delete: :cascade } diff --git a/db/seeds.rb b/db/seeds.rb index decba22..853470c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -8,5 +8,5 @@ team1 = tournament.teams.create name: Faker::Dog.name team2 = tournament.teams.create name: Faker::Dog.name stage = tournament.stages.create! match = stage.matches.create! -match.scores.create! team: team1, score: 0 -match.scores.create! team: team2, score: 1 +match.match_scores.create! team: team1, points: 0 +match.match_scores.create! team: team2, points: 1 diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb index 84f4c2c..d05e1b9 100644 --- a/spec/controllers/matches_controller_spec.rb +++ b/spec/controllers/matches_controller_spec.rb @@ -5,7 +5,7 @@ require 'rails_helper' RSpec.describe MatchesController, type: :controller do before do @match = create(:match) - @match.scores = create_pair(:score) + @match.match_scores = create_pair(:match_score) end describe 'GET #show' do @@ -19,7 +19,7 @@ RSpec.describe MatchesController, type: :controller do get :show, params: { id: @match.to_param } body = ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body)) expect(body[:state]).to eq(@match.state) - expect(body[:score_ids]).to eq(@match.scores.map { |score| score.id.to_s }) + expect(body[:match_score_ids]).to eq(@match.match_scores.map { |match_score| match_score.id.to_s }) end end end diff --git a/spec/factories/scores.rb b/spec/factories/match_scores.rb similarity index 60% rename from spec/factories/scores.rb rename to spec/factories/match_scores.rb index 7de51f0..34e1320 100644 --- a/spec/factories/scores.rb +++ b/spec/factories/match_scores.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true FactoryBot.define do - factory :score do - score { rand(0..10) } + factory :match_score do + points { rand(0..10) } match team end diff --git a/spec/factories/matches.rb b/spec/factories/matches.rb index b35703d..773151f 100644 --- a/spec/factories/matches.rb +++ b/spec/factories/matches.rb @@ -5,10 +5,10 @@ FactoryBot.define do stage factory :running_playoff_match do transient do - scores_count { 2 } + match_scores_count { 2 } end after(:create) do |match, evaluator| - match.scores = create_list(:score, evaluator.scores_count) + match.match_scores = create_list(:match_score, evaluator.match_scores_count) end state { 3 } end diff --git a/spec/models/score_spec.rb b/spec/models/match_score_spec.rb similarity index 69% rename from spec/models/score_spec.rb rename to spec/models/match_score_spec.rb index 4d68364..a48734f 100644 --- a/spec/models/score_spec.rb +++ b/spec/models/match_score_spec.rb @@ -2,13 +2,13 @@ require 'rails_helper' -RSpec.describe Score, type: :model do +RSpec.describe MatchScore, type: :model do describe 'association' do it { should belong_to :match } it { should belong_to :team } end it 'has a valid factory' do - expect(build(:score)).to be_valid + expect(build(:match_score)).to be_valid end end diff --git a/spec/models/match_spec.rb b/spec/models/match_spec.rb index 7eb6c67..74fc582 100644 --- a/spec/models/match_spec.rb +++ b/spec/models/match_spec.rb @@ -4,7 +4,7 @@ require 'rails_helper' RSpec.describe Match, type: :model do context 'association' do - it { should have_many :scores } + it { should have_many :match_scores } it { should belong_to :stage } it { should belong_to :group } end @@ -26,20 +26,20 @@ RSpec.describe Match, type: :model do end end - context 'scores' do + context 'match_scores' do before do @match = create(:match) - @match.scores << build_pair(:score) + @match.match_scores << build_pair(:match_score) end - it 'can only have two scores' do - @match.scores << build(:score) + it 'can only have two match_scores' do + @match.match_scores << build(:match_score) expect(@match).to be_invalid end - it 'can access its scores' do - @match.scores[0].score = 0 - @match.scores[1].score = 0 + it 'can access its match_scores' do + @match.match_scores[0].points = 0 + @match.match_scores[1].points = 0 end end diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb index 23b38bf..b930c5c 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/team_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Team, type: :model do describe 'association' do it { should belong_to :tournament } it { should have_many :group_scores } - it { should have_many :scores } + it { should have_many :match_scores } end it 'has a valid factory' do diff --git a/spec/services/match_service_spec.rb b/spec/services/match_service_spec.rb index 7706e1f..09fc450 100644 --- a/spec/services/match_service_spec.rb +++ b/spec/services/match_service_spec.rb @@ -59,8 +59,8 @@ RSpec.describe MatchService do generated_matches = MatchService.generate_matches teams generated_matches.each_index do |index| match = generated_matches[index] - first_team = match.scores.first.team.name - second_team = match.scores.second.team.name + first_team = match.match_scores.first.team.name + second_team = match.match_scores.second.team.name expect(first_team).to eq(teams[2 * index].name) expect(second_team).to eq(teams[2 * index + 1].name) end From ed3b8311fd1372cd52e2bb6bbec614dd3c825465 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 30 Nov 2018 14:20:57 +0100 Subject: [PATCH 3/3] Regenerate SVGs --- doc/controllers_brief.svg | 351 +++++++------- doc/controllers_complete.svg | 879 +++++++++++++++++++---------------- doc/models_brief.svg | 340 ++++++++------ doc/models_complete.svg | 478 +++++++++++-------- 4 files changed, 1147 insertions(+), 901 deletions(-) diff --git a/doc/controllers_brief.svg b/doc/controllers_brief.svg index 016ff8e..5a49a48 100644 --- a/doc/controllers_brief.svg +++ b/doc/controllers_brief.svg @@ -4,220 +4,253 @@ - - + + controllers_diagram - + _diagram_info -Controllers diagram -Date: Nov 12 2018 - 13:00 -Migration version: 0 -Generated by RailRoady 1.5.3 -http://railroady.prestonlee.com +Controllers diagram +Date: Nov 30 2018 - 13:55 +Migration version: 0 +Generated by RailRoady 1.5.3 +http://railroady.prestonlee.com ApplicationController - -ApplicationController + +ApplicationController + + + +TeamsController + +TeamsController + + + +ApplicationController->TeamsController + + + + +TournamentsController + +TournamentsController + + + +ApplicationController->TournamentsController + + + + +MatchesController + +MatchesController + + + +ApplicationController->MatchesController + - + DeviseController - -DeviseController + +DeviseController - + ApplicationController->DeviseController - - - - -ActiveStorage::DiskController - -ActiveStorage::DiskController + - -ActiveStorage::RepresentationsController - -ActiveStorage::RepresentationsController - - - -ActiveStorage::BaseController - -ActiveStorage::BaseController - - -ActiveStorage::DirectUploadsController - -ActiveStorage::DirectUploadsController +ActiveStorage::RepresentationsController + +ActiveStorage::RepresentationsController ActiveStorage::BlobsController - -ActiveStorage::BlobsController + +ActiveStorage::BlobsController - + + +ActiveStorage::DiskController + +ActiveStorage::DiskController + + -Devise::UnlocksController - -Devise::UnlocksController +ActiveStorage::DirectUploadsController + +ActiveStorage::DirectUploadsController - - -DeviseController->Devise::UnlocksController - - - + -Devise::RegistrationsController - -Devise::RegistrationsController - - - -DeviseController->Devise::RegistrationsController - - - - -Devise::ConfirmationsController - -Devise::ConfirmationsController - - - -DeviseController->Devise::ConfirmationsController - - - - -Devise::OmniauthCallbacksController - -Devise::OmniauthCallbacksController - - - -DeviseController->Devise::OmniauthCallbacksController - +ActiveStorage::BaseController + +ActiveStorage::BaseController - + Devise::PasswordsController - -Devise::PasswordsController + +Devise::PasswordsController - - -DeviseController->Devise::PasswordsController - + + +Devise::RegistrationsController + +Devise::RegistrationsController + + + +Devise::ConfirmationsController + +Devise::ConfirmationsController Devise::SessionsController - -Devise::SessionsController + +Devise::SessionsController + + + +Devise::UnlocksController + +Devise::UnlocksController + + + +Devise::OmniauthCallbacksController + +Devise::OmniauthCallbacksController + + + +DeviseController->Devise::PasswordsController + + + + +DeviseController->Devise::RegistrationsController + + + + +DeviseController->Devise::ConfirmationsController + DeviseController->Devise::SessionsController - + + + + +DeviseController->Devise::UnlocksController + + + + +DeviseController->Devise::OmniauthCallbacksController + - + DeviseTokenAuth::ApplicationController - -DeviseTokenAuth::ApplicationController + +DeviseTokenAuth::ApplicationController - -DeviseController->DeviseTokenAuth::ApplicationController - - - - -DeviseTokenAuth::UnlocksController - -DeviseTokenAuth::UnlocksController - - - -DeviseTokenAuth::RegistrationsController - -DeviseTokenAuth::RegistrationsController - - - -DeviseTokenAuth::ConfirmationsController - -DeviseTokenAuth::ConfirmationsController - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::UnlocksController - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::RegistrationsController - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::ConfirmationsController - - - - -DeviseTokenAuth::OmniauthCallbacksController - -DeviseTokenAuth::OmniauthCallbacksController - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::OmniauthCallbacksController - - - - -DeviseTokenAuth::TokenValidationsController - -DeviseTokenAuth::TokenValidationsController - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::TokenValidationsController - +DeviseController->DeviseTokenAuth::ApplicationController + - + DeviseTokenAuth::PasswordsController - -DeviseTokenAuth::PasswordsController + +DeviseTokenAuth::PasswordsController - + DeviseTokenAuth::ApplicationController->DeviseTokenAuth::PasswordsController - + + + + +DeviseTokenAuth::RegistrationsController + +DeviseTokenAuth::RegistrationsController + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::RegistrationsController + + + + +DeviseTokenAuth::ConfirmationsController + +DeviseTokenAuth::ConfirmationsController + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::ConfirmationsController + + + + +DeviseTokenAuth::TokenValidationsController + +DeviseTokenAuth::TokenValidationsController + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::TokenValidationsController + - + DeviseTokenAuth::SessionsController - -DeviseTokenAuth::SessionsController + +DeviseTokenAuth::SessionsController - + DeviseTokenAuth::ApplicationController->DeviseTokenAuth::SessionsController - + + + + +DeviseTokenAuth::UnlocksController + +DeviseTokenAuth::UnlocksController + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::UnlocksController + + + + +DeviseTokenAuth::OmniauthCallbacksController + +DeviseTokenAuth::OmniauthCallbacksController + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::OmniauthCallbacksController + diff --git a/doc/controllers_complete.svg b/doc/controllers_complete.svg index 431be6b..5556215 100644 --- a/doc/controllers_complete.svg +++ b/doc/controllers_complete.svg @@ -4,472 +4,529 @@ - - + + controllers_diagram - + _diagram_info -Controllers diagram -Date: Nov 12 2018 - 13:00 -Migration version: 0 -Generated by RailRoady 1.5.3 -http://railroady.prestonlee.com +Controllers diagram +Date: Nov 30 2018 - 13:55 +Migration version: 0 +Generated by RailRoady 1.5.3 +http://railroady.prestonlee.com ApplicationController - -ApplicationController - - -configure_permitted_parameters - + +ApplicationController + + +configure_permitted_parameters + +deserialize_params +render_forbidden_error +require_owner! + + + +TeamsController + +TeamsController + +show +update + + +set_team +team_params + + + +ApplicationController->TeamsController + + + + +TournamentsController + +TournamentsController + +create +destroy +index +show +update + + +set_tournament +tournament_params + + + +ApplicationController->TournamentsController + + + + +MatchesController + +MatchesController + +show + + + + + +ApplicationController->MatchesController + - + DeviseController - -DeviseController - -_prefixes - -assert_is_devise_resource! -clean_up_passwords -devise_i18n_options -devise_mapping -find_message -navigational_formats -require_no_authentication -resource -resource= -resource_class -resource_name -resource_params -respond_with_navigational -scope_name -set_flash_message -set_flash_message! -set_minimum_password_length -signed_in_resource -successfully_sent? -translation_scope -unknown_action! - + +DeviseController + +_prefixes + +assert_is_devise_resource! +clean_up_passwords +devise_i18n_options +devise_mapping +find_message +navigational_formats +require_no_authentication +resource +resource= +resource_class +resource_name +resource_params +respond_with_navigational +scope_name +set_flash_message +set_flash_message! +set_minimum_password_length +signed_in_resource +successfully_sent? +translation_scope +unknown_action! + - + ApplicationController->DeviseController - - - - -ActiveStorage::DiskController - -ActiveStorage::DiskController - -show -update - - -_layout -acceptable_content? -decode_verified_key -decode_verified_token -disk_service + - -ActiveStorage::RepresentationsController - -ActiveStorage::RepresentationsController - -show - - -_layout - - - -ActiveStorage::BaseController - -ActiveStorage::BaseController - - - -_layout - - -ActiveStorage::DirectUploadsController - -ActiveStorage::DirectUploadsController - -create - - -_layout -blob_args -direct_upload_json +ActiveStorage::RepresentationsController + +ActiveStorage::RepresentationsController + +show + + +_layout ActiveStorage::BlobsController - -ActiveStorage::BlobsController - -show - - -_layout + +ActiveStorage::BlobsController + +show + + +_layout - + + +ActiveStorage::DiskController + +ActiveStorage::DiskController + +show +update + + +_layout +acceptable_content? +decode_verified_key +decode_verified_token +disk_service + + -Devise::UnlocksController - -Devise::UnlocksController - -create -new -show - -after_sending_unlock_instructions_path_for -after_unlock_path_for -translation_scope - +ActiveStorage::DirectUploadsController + +ActiveStorage::DirectUploadsController + +create + + +_layout +blob_args +direct_upload_json - - -DeviseController->Devise::UnlocksController - - - + -Devise::RegistrationsController - -Devise::RegistrationsController - -cancel -create -destroy -edit -new -update - -account_update_params -after_inactive_sign_up_path_for -after_sign_up_path_for -after_update_path_for -authenticate_scope! -build_resource -sign_up -sign_up_params -translation_scope -update_needs_confirmation? -update_resource - - - - -DeviseController->Devise::RegistrationsController - - - - -Devise::ConfirmationsController - -Devise::ConfirmationsController - -create -new -show - -after_confirmation_path_for -after_resending_confirmation_instructions_path_for -translation_scope - - - - -DeviseController->Devise::ConfirmationsController - - - - -Devise::OmniauthCallbacksController - -Devise::OmniauthCallbacksController - -failure -passthru - -after_omniauth_failure_path_for -failed_strategy -failure_message -translation_scope - - - - -DeviseController->Devise::OmniauthCallbacksController - +ActiveStorage::BaseController + +ActiveStorage::BaseController + + + +_layout - + Devise::PasswordsController - -Devise::PasswordsController - -create -edit -new -update - -after_resetting_password_path_for -after_sending_reset_password_instructions_path_for -assert_reset_token_passed -translation_scope -unlockable? - + +Devise::PasswordsController + +create +edit +new +update + +after_resetting_password_path_for +after_sending_reset_password_instructions_path_for +assert_reset_token_passed +translation_scope +unlockable? + - - -DeviseController->Devise::PasswordsController - + + +Devise::RegistrationsController + +Devise::RegistrationsController + +cancel +create +destroy +edit +new +update + +account_update_params +after_inactive_sign_up_path_for +after_sign_up_path_for +after_update_path_for +authenticate_scope! +build_resource +sign_up +sign_up_params +translation_scope +update_needs_confirmation? +update_resource + + + + +Devise::ConfirmationsController + +Devise::ConfirmationsController + +create +new +show + +after_confirmation_path_for +after_resending_confirmation_instructions_path_for +translation_scope + Devise::SessionsController - -Devise::SessionsController - -create -destroy -new - -auth_options -serialize_options -sign_in_params -translation_scope - -all_signed_out? -respond_to_on_destroy -verify_signed_out_user + +Devise::SessionsController + +create +destroy +new + +auth_options +serialize_options +sign_in_params +translation_scope + +all_signed_out? +respond_to_on_destroy +verify_signed_out_user + + + +Devise::UnlocksController + +Devise::UnlocksController + +create +new +show + +after_sending_unlock_instructions_path_for +after_unlock_path_for +translation_scope + + + + +Devise::OmniauthCallbacksController + +Devise::OmniauthCallbacksController + +failure +passthru + +after_omniauth_failure_path_for +failed_strategy +failure_message +translation_scope + + + + +DeviseController->Devise::PasswordsController + + + + +DeviseController->Devise::RegistrationsController + + + + +DeviseController->Devise::ConfirmationsController + DeviseController->Devise::SessionsController - + + + + +DeviseController->Devise::UnlocksController + + + + +DeviseController->Devise::OmniauthCallbacksController + - + DeviseTokenAuth::ApplicationController - -DeviseTokenAuth::ApplicationController - -resource_data -resource_errors - -blacklisted_redirect_url? -build_redirect_headers -confirmable_enabled? -json_api? -params_for_resource -recoverable_enabled? -render_error -resource_class - + +DeviseTokenAuth::ApplicationController + +resource_data +resource_errors + +blacklisted_redirect_url? +build_redirect_headers +confirmable_enabled? +json_api? +params_for_resource +recoverable_enabled? +render_error +resource_class + - -DeviseController->DeviseTokenAuth::ApplicationController - - - - -DeviseTokenAuth::UnlocksController - -DeviseTokenAuth::UnlocksController - -create -show - - -after_unlock_path_for -render_create_error -render_create_error_missing_email -render_create_success -render_not_found_error -render_show_error -resource_params - - - -DeviseTokenAuth::RegistrationsController - -DeviseTokenAuth::RegistrationsController - -account_update_params -create -destroy -sign_up_params -update - -build_resource -render_create_error -render_create_error_email_already_exists -render_create_error_missing_confirm_success_url -render_create_error_redirect_url_not_allowed -render_create_success -render_destroy_error -render_destroy_success -render_update_error -render_update_error_user_not_found -render_update_success - -resource_update_method -validate_account_update_params -validate_post_data -validate_sign_up_params - - - -DeviseTokenAuth::ConfirmationsController - -DeviseTokenAuth::ConfirmationsController - -show - - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::UnlocksController - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::RegistrationsController - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::ConfirmationsController - - - - -DeviseTokenAuth::OmniauthCallbacksController - -DeviseTokenAuth::OmniauthCallbacksController - -auth_params -omniauth_failure -omniauth_success -redirect_callbacks - -assert_is_devise_resource! -assign_provider_attrs -auth_hash -auth_origin_url -create_auth_params -devise_mapping -fallback_render -get_resource_from_auth_hash -omniauth_params -omniauth_window_type -render_data -render_data_or_redirect -resource_class -resource_name -set_random_password -set_token_on_resource -whitelisted_params - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::OmniauthCallbacksController - - - - -DeviseTokenAuth::TokenValidationsController - -DeviseTokenAuth::TokenValidationsController - -validate_token - -render_validate_token_error -render_validate_token_success - - - - -DeviseTokenAuth::ApplicationController->DeviseTokenAuth::TokenValidationsController - +DeviseController->DeviseTokenAuth::ApplicationController + - + DeviseTokenAuth::PasswordsController - -DeviseTokenAuth::PasswordsController - -create -edit -update - -render_create_error -render_create_error_missing_email -render_create_error_missing_redirect_url -render_create_error_not_allowed_redirect_url -render_create_success -render_edit_error -render_update_error -render_update_error_missing_password -render_update_error_password_not_required -render_update_error_unauthorized -render_update_success -resource_update_method - -password_resource_params -render_not_found_error -resource_params -with_reset_password_token + +DeviseTokenAuth::PasswordsController + +create +edit +update + +render_create_error +render_create_error_missing_email +render_create_error_missing_redirect_url +render_create_error_not_allowed_redirect_url +render_create_success +render_edit_error +render_update_error +render_update_error_missing_password +render_update_error_password_not_required +render_update_error_unauthorized +render_update_success +resource_update_method + +password_resource_params +render_not_found_error +resource_params +with_reset_password_token - + DeviseTokenAuth::ApplicationController->DeviseTokenAuth::PasswordsController - + + + + +DeviseTokenAuth::RegistrationsController + +DeviseTokenAuth::RegistrationsController + +account_update_params +create +destroy +sign_up_params +update + +build_resource +render_create_error +render_create_error_email_already_exists +render_create_error_missing_confirm_success_url +render_create_error_redirect_url_not_allowed +render_create_success +render_destroy_error +render_destroy_success +render_update_error +render_update_error_user_not_found +render_update_success + +resource_update_method +validate_account_update_params +validate_post_data +validate_sign_up_params + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::RegistrationsController + + + + +DeviseTokenAuth::ConfirmationsController + +DeviseTokenAuth::ConfirmationsController + +show + + + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::ConfirmationsController + + + + +DeviseTokenAuth::TokenValidationsController + +DeviseTokenAuth::TokenValidationsController + +validate_token + +render_validate_token_error +render_validate_token_success + + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::TokenValidationsController + - + DeviseTokenAuth::SessionsController - -DeviseTokenAuth::SessionsController - -create -destroy -new - -get_auth_params -render_create_error_account_locked -render_create_error_bad_credentials -render_create_error_not_confirmed -render_create_success -render_destroy_error -render_destroy_success -render_new_error -valid_params? - -resource_params + +DeviseTokenAuth::SessionsController + +create +destroy +new + +get_auth_params +render_create_error_account_locked +render_create_error_bad_credentials +render_create_error_not_confirmed +render_create_success +render_destroy_error +render_destroy_success +render_new_error +valid_params? + +resource_params - + DeviseTokenAuth::ApplicationController->DeviseTokenAuth::SessionsController - + + + + +DeviseTokenAuth::UnlocksController + +DeviseTokenAuth::UnlocksController + +create +show + + +after_unlock_path_for +render_create_error +render_create_error_missing_email +render_create_success +render_not_found_error +render_show_error +resource_params + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::UnlocksController + + + + +DeviseTokenAuth::OmniauthCallbacksController + +DeviseTokenAuth::OmniauthCallbacksController + +auth_params +omniauth_failure +omniauth_success +redirect_callbacks + +assert_is_devise_resource! +assign_provider_attrs +auth_hash +auth_origin_url +create_auth_params +devise_mapping +fallback_render +get_resource_from_auth_hash +omniauth_params +omniauth_window_type +render_data +render_data_or_redirect +resource_class +resource_name +set_random_password +set_token_on_resource +whitelisted_params + + + + +DeviseTokenAuth::ApplicationController->DeviseTokenAuth::OmniauthCallbacksController + diff --git a/doc/models_brief.svg b/doc/models_brief.svg index 0faaddd..aead51b 100644 --- a/doc/models_brief.svg +++ b/doc/models_brief.svg @@ -4,191 +4,267 @@ - - + + models_diagram - + _diagram_info -Models diagram -Date: Nov 12 2018 - 13:00 -Migration version: 0 -Generated by RailRoady 1.5.3 -http://railroady.prestonlee.com +Models diagram +Date: Nov 30 2018 - 13:55 +Migration version: 0 +Generated by RailRoady 1.5.3 +http://railroady.prestonlee.com - + -User - -User +Stage + +Stage - - -Team - -Team + + +Group + +Group + + + +Stage->Group + + + - + Match - -Match + +Match - + + +Stage->Match + + + + + + +Tournament + +Tournament + + + +Tournament->Stage + + + + + + +Team + +Team + + + +Tournament->Team + + + + + -PlayoffStage - -PlayoffStage +GroupScore + +GroupScore + + + +Group->GroupScore + + + + + + +Group->Match + + + ApplicationRecord - -ApplicationRecord + +ApplicationRecord - - -ApplicationRecord->User - - - - -ApplicationRecord->Team - - - + -ApplicationRecord->Match - - - - -ApplicationRecord->PlayoffStage - - - - -GroupStage - -GroupStage - - - -ApplicationRecord->GroupStage - - - - -Group - -Group - - - -ApplicationRecord->Group - - - - -Tournament - -Tournament +ApplicationRecord->Stage + - + ApplicationRecord->Tournament - + - + + +ApplicationRecord->Group + + + + +ApplicationRecord->GroupScore + + + + +ApplicationRecord->Match + + + + +ApplicationRecord->Team + + + + +User + +User + + + +ApplicationRecord->User + + + + +MatchScore + +MatchScore + + + +Match->MatchScore + + + + + + +Team->GroupScore + + + + + + +Team->MatchScore + + + + + + +User->Tournament + + + + + -ActiveStorage::Attachment - -ActiveStorage::Attachment +ActiveStorage::Blob + +ActiveStorage::Blob - + -ActiveStorage::Variation - -ActiveStorage::Variation +ActiveStorage::Filename::Parameters + +ActiveStorage::Filename::Parameters - + -ActiveStorage::Blob::Representable - -ActiveStorage::Blob::Representable +ActiveStorage::Variant + +ActiveStorage::Variant - + -ActiveStorage::Blob::Identifiable - -ActiveStorage::Blob::Identifiable +ActiveStorage::Preview + +ActiveStorage::Preview ActiveStorage::Blob::Analyzable - -ActiveStorage::Blob::Analyzable + +ActiveStorage::Blob::Analyzable - + -ActiveStorage::Preview - -ActiveStorage::Preview +ActiveStorage::Blob::Identifiable + +ActiveStorage::Blob::Identifiable - + -ActiveStorage::Variant - -ActiveStorage::Variant - - - -ActiveStorage::Filename - -ActiveStorage::Filename +ActiveStorage::Blob::Representable + +ActiveStorage::Blob::Representable - + ActiveStorage::Current - -ActiveStorage::Current + +ActiveStorage::Current - + + +ActiveStorage::Attachment + +ActiveStorage::Attachment + + -ActiveStorage::Blob - -ActiveStorage::Blob +ActiveStorage::Filename + +ActiveStorage::Filename - + -ActiveStorage::Filename::Parameters - -ActiveStorage::Filename::Parameters - - - -DeviseTokenAuth::Concerns::User - -DeviseTokenAuth::Concerns::User +ActiveStorage::Variation + +ActiveStorage::Variation - + DeviseTokenAuth::Concerns::UserOmniauthCallbacks - -DeviseTokenAuth::Concerns::UserOmniauthCallbacks + +DeviseTokenAuth::Concerns::UserOmniauthCallbacks + + + +DeviseTokenAuth::Concerns::User + +DeviseTokenAuth::Concerns::User - + ActiveSupport::CurrentAttributes - -ActiveSupport::CurrentAttributes + +ActiveSupport::CurrentAttributes - + ActiveSupport::CurrentAttributes->ActiveStorage::Current - + diff --git a/doc/models_complete.svg b/doc/models_complete.svg index 24973e8..058d525 100644 --- a/doc/models_complete.svg +++ b/doc/models_complete.svg @@ -4,254 +4,334 @@ - - + + models_diagram - + _diagram_info -Models diagram -Date: Nov 12 2018 - 13:00 -Migration version: 0 -Generated by RailRoady 1.5.3 -http://railroady.prestonlee.com +Models diagram +Date: Nov 30 2018 - 13:55 +Migration version: 0 +Generated by RailRoady 1.5.3 +http://railroady.prestonlee.com - + -User - -User - -id :integer -provider :varchar -uid :varchar -encrypted_password :varchar -reset_password_token :varchar -reset_password_sent_at :datetime -allow_password_change :boolean -remember_created_at :datetime -sign_in_count :integer -current_sign_in_at :datetime -last_sign_in_at :datetime -current_sign_in_ip :varchar -last_sign_in_ip :varchar -confirmation_token :varchar -confirmed_at :datetime -confirmation_sent_at :datetime -unconfirmed_email :varchar -username :varchar -email :varchar -tokens :text -created_at :datetime -updated_at :datetime +Stage + +Stage + +id :integer +level :integer +tournament_id :integer +created_at :datetime +updated_at :datetime - - -Team - -Team - -id :integer -name :varchar -group_score :integer -group_points_scored :integer -group_points_recieved :integer -created_at :datetime -updated_at :datetime + + +Group + +Group + +id :integer +number :integer +stage_id :integer +created_at :datetime +updated_at :datetime + + + +Stage->Group + + + - + Match - -Match - -id :integer -score_team_1 :integer -score_team_2 :integer -state :integer -position :integer -is_group_match :boolean -created_at :datetime -updated_at :datetime + +Match + +id :integer +state :integer +position :integer +stage_id :integer +group_id :integer +created_at :datetime +updated_at :datetime - + + +Stage->Match + + + + + + +Tournament + +Tournament + +id :integer +name :varchar +code :varchar +description :varchar +public :boolean +user_id :integer +created_at :datetime +updated_at :datetime + + + +Tournament->Stage + + + + + + +Team + +Team + +id :integer +name :varchar +tournament_id :integer +created_at :datetime +updated_at :datetime + + + +Tournament->Team + + + + + -PlayoffStage - -PlayoffStage - -id :integer -level :integer -created_at :datetime -updated_at :datetime +GroupScore + +GroupScore + +id :integer +score :integer +points_scored :integer +points_received :integer +team_id :integer +group_id :integer +created_at :datetime +updated_at :datetime + + + +Group->GroupScore + + + + + + +Group->Match + + + ApplicationRecord - -ApplicationRecord + +ApplicationRecord - - -ApplicationRecord->User - - - - -ApplicationRecord->Team - - - + -ApplicationRecord->Match - - - - -ApplicationRecord->PlayoffStage - - - - -GroupStage - -GroupStage - -id :integer -playoff_size :integer -created_at :datetime -updated_at :datetime - - - -ApplicationRecord->GroupStage - - - - -Group - -Group - -id :integer -name :varchar -created_at :datetime -updated_at :datetime - - - -ApplicationRecord->Group - - - - -Tournament - -Tournament - -id :integer -name :varchar -code :varchar -description :varchar -public :boolean -created_at :datetime -updated_at :datetime +ApplicationRecord->Stage + - + ApplicationRecord->Tournament - + - + + +ApplicationRecord->Group + + + + +ApplicationRecord->GroupScore + + + + +ApplicationRecord->Match + + + + +ApplicationRecord->Team + + + + +User + +User + +id :integer +provider :varchar +uid :varchar +encrypted_password :varchar +reset_password_token :varchar +reset_password_sent_at :datetime +allow_password_change :boolean +remember_created_at :datetime +sign_in_count :integer +current_sign_in_at :datetime +last_sign_in_at :datetime +current_sign_in_ip :varchar +last_sign_in_ip :varchar +confirmation_token :varchar +confirmed_at :datetime +confirmation_sent_at :datetime +unconfirmed_email :varchar +username :varchar +email :varchar +tokens :text +created_at :datetime +updated_at :datetime + + + +ApplicationRecord->User + + + + +MatchScore + +MatchScore + + + +Match->MatchScore + + + + + + +Team->GroupScore + + + + + + +Team->MatchScore + + + + + + +User->Tournament + + + + + -ActiveStorage::Variation - -ActiveStorage::Variation - - +ActiveStorage::Filename::Parameters + +ActiveStorage::Filename::Parameters + + - + -ActiveStorage::Blob::Representable - -ActiveStorage::Blob::Representable +ActiveStorage::Variant + +ActiveStorage::Variant + + - + -ActiveStorage::Blob::Identifiable - -ActiveStorage::Blob::Identifiable +ActiveStorage::Preview + +ActiveStorage::Preview + + ActiveStorage::Blob::Analyzable - -ActiveStorage::Blob::Analyzable + +ActiveStorage::Blob::Analyzable - + -ActiveStorage::Preview - -ActiveStorage::Preview - - +ActiveStorage::Blob::Identifiable + +ActiveStorage::Blob::Identifiable - + -ActiveStorage::Variant - -ActiveStorage::Variant - - - - - -ActiveStorage::Filename - -ActiveStorage::Filename - - +ActiveStorage::Blob::Representable + +ActiveStorage::Blob::Representable - + ActiveStorage::Current - -ActiveStorage::Current - - + +ActiveStorage::Current + + - + + +ActiveStorage::Filename + +ActiveStorage::Filename + + + + -ActiveStorage::Filename::Parameters - -ActiveStorage::Filename::Parameters - - - - - -DeviseTokenAuth::Concerns::User - -DeviseTokenAuth::Concerns::User +ActiveStorage::Variation + +ActiveStorage::Variation + + - + DeviseTokenAuth::Concerns::UserOmniauthCallbacks - -DeviseTokenAuth::Concerns::UserOmniauthCallbacks + +DeviseTokenAuth::Concerns::UserOmniauthCallbacks + + + +DeviseTokenAuth::Concerns::User + +DeviseTokenAuth::Concerns::User - + ActiveSupport::CurrentAttributes - -ActiveSupport::CurrentAttributes + +ActiveSupport::CurrentAttributes - + ActiveSupport::CurrentAttributes->ActiveStorage::Current - +