Skip to content

Commit

Permalink
remove user
Browse files Browse the repository at this point in the history
  • Loading branch information
apprentice1988 committed Oct 24, 2015
1 parent b28dba9 commit dbf19d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def show

def start
@project = Project.find(params[:id])
@user = User.first
# @user = User.first
# @parti = Participation.find_or_initialize_by(project_id: @project.id, user_id: @user.id)
@parti = @user.participations.create(project_id: @project.id, status: 'doing')
@parti = Participations.create(project_id: @project.id, status: 'doing')
render json: { success: true }
end

def checkin
@project = Project.find(params[:id])
@user = User.first
# @user = User.first
if @project.distance([params[:coordinates].try(&:first).to_f, params[:coordinates].try(&:last).to_f]) <= 2
render json: { success: true, content: @project.puzzle.answer, hint: @project.puzzle.hint }
else
Expand All @@ -28,9 +28,9 @@ def checkin

def validate
@project = Project.find(params[:id])
@user = User.first
# @user = User.first
if @project.puzzle.answer == params[:answer]
@parti = @user.participations.find_by(project_id: @project.id)
@parti = Participation.find_by(project_id: @project.id)
@parti.update(status: 'finished')
render json: { success: true }
else
Expand Down

0 comments on commit dbf19d9

Please sign in to comment.