@@ -149,7 +149,7 @@ class ContestantsController < ApplicationController
|
||||
end
|
||||
@contest = @contestant.contest
|
||||
I18n.locale = @contest.lang
|
||||
@puzzles = @contest.puzzles
|
||||
@puzzles = @contest.puzzles.where(hidden: false).or(@contest.puzzles.where(hidden: nil)).order(:id)
|
||||
@completion = Completion.new
|
||||
@completion.completed = true
|
||||
@public = true
|
||||
|
||||
@@ -99,7 +99,7 @@ class ContestsController < ApplicationController
|
||||
if params.key?(:hide_offline) && params[:hide_offline] == "true"
|
||||
@contestants = @contestants.select { |contestant| !contestant.offline.present? }
|
||||
end
|
||||
@puzzles = @contest.puzzles.order(:id)
|
||||
@puzzles = @contest.puzzles.where(hidden: false).or(@contest.puzzles.where(hidden: nil)).order(:id)
|
||||
if params.key?(:hide_offline) && params.key?(:category)
|
||||
@action_path = "/public/#{@contest.friendly_id}?hide_offline=#{params[:hide_offline]}&category=#{params[:category]}"
|
||||
elsif params.key?(:category)
|
||||
|
||||
@@ -59,6 +59,6 @@ class PuzzlesController < ApplicationController
|
||||
end
|
||||
|
||||
def puzzle_params
|
||||
params.expect(puzzle: [ :brand, :name, :image, :pieces ])
|
||||
params.expect(puzzle: [ :brand, :name, :image, :pieces, :hidden ])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user