Skip to content

Conversation

@cx-nir-cohen
Copy link
Owner

No description provided.

player.user_id = i[:userId]
player.correct_questions = i[:correctQuestions]
player.incorrent_questions = i[:incorrectQuestions]
player.tournament_id = tournament.tournament_id

Choose a reason for hiding this comment

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

This is very confusing - the Rails convention would be that player.tournament_id would hold tournament.id, not tournament.tournament_id
That's how ActiveRecord knows how to find it in the DB with the belongs_to relation

Copy link
Owner Author

Choose a reason for hiding this comment

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

no sure I got you.

class TournamentsController < ApplicationController
skip_before_action :verify_authenticity_token

def saveTournamentResults

Choose a reason for hiding this comment

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

Always use snake_case - same goes for all of the other endpoints

Suggested change
def saveTournamentResults
def save_tournament_results

Copy link
Owner Author

Choose a reason for hiding this comment

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

how its can be?
how you can config a route with snake_case? there is a way to configure route as usual and route it to the controller with snake_case?

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.

3 participants