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

completed games mvc #2

Merged
merged 3 commits into from Feb 1, 2017
Merged

completed games mvc #2

merged 3 commits into from Feb 1, 2017

Conversation

tscalzo000
Copy link
Owner

Added games views, buttons for all models, completed necessary CRUD actions for each model, created the profile page, specified views for visitors/players/DM

…ctions for each model, created the profile page, specified views for visitors/players/DM
sequence(:username) { |n| 'testuser{n}' }
sequence(:email) { |n| 'test{n}@test.com' }
sequence(:username) { |n| 'testuser#{n}' }
sequence(:email) { |n| 'test#{n}@test.com' }

Choose a reason for hiding this comment

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

Unused block argument - n. You can omit the argument if you don't care about it.

@@ -1,7 +1,7 @@
FactoryGirl.define do
factory :user do
sequence(:username) { |n| 'testuser{n}' }
sequence(:email) { |n| 'test{n}@test.com' }
sequence(:username) { |n| 'testuser#{n}' }

Choose a reason for hiding this comment

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

Unused block argument - n. You can omit the argument if you don't care about it.

@@ -1,6 +1,6 @@
FactoryGirl.define do
factory :game do
sequence(:name) { |n| 'testgame{n}' }
sequence(:name) { |n| 'testgame#{n}' }

Choose a reason for hiding this comment

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

Unused block argument - n. You can omit the argument if you don't care about it.

flash[:notice] = "#{@signup.user.username} has been added to #{@signup.game.name}"
redirect_to game_path(@game)
else
flash[:notice] = 'Error. Please make sure the username is spelled correctly, including capitalization'

Choose a reason for hiding this comment

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

Line is too long. [108/80]

@signup = Signup.create(user: @user, game: @game)
Request.where(user: @user, game: @game).delete_all
if @signup.save
flash[:notice] = "#{@signup.user.username} has been added to #{@signup.game.name}"

Choose a reason for hiding this comment

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

Line is too long. [88/80]

private

def comment_params
params.require(:comment).permit (

Choose a reason for hiding this comment

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

Don't use parentheses around a literal.

@@ -0,0 +1,25 @@
class CommentsController < ApplicationController

Choose a reason for hiding this comment

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

Extra empty line detected at class body beginning.

document.getElementById('div1').style.display='none';
if (document.getElementById('writecomment') != null) {
document.getElementById('writecomment').style.display='block'
};

Choose a reason for hiding this comment

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

Unnecessary semicolon.

function hidefield() {
document.getElementById('div1').style.display='none';
if (document.getElementById('writecomment') != null) {
document.getElementById('writecomment').style.display='block'

Choose a reason for hiding this comment

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

Missing semicolon.


function hidefield() {
document.getElementById('div1').style.display='none';
if (document.getElementById('writecomment') != null) {

Choose a reason for hiding this comment

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

Use '!==' to compare with 'null'.

@@ -1,13 +1,17 @@
require 'rails_helper'

describe GamesController, type: :controller do
include Devise::Test::ControllerHelpers

Choose a reason for hiding this comment

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

Trailing whitespace detected.

@tscalzo000 tscalzo000 merged commit a3043b1 into master Feb 1, 2017
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.

None yet

2 participants