diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/wittle/puzzles_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/wittle/puzzles_controller.rb b/app/controllers/wittle/puzzles_controller.rb index 2949f94..3c3c8a6 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb | |||
@@ -3,10 +3,11 @@ module Wittle | |||
3 | def about | 3 | def about |
4 | @normal_puzzle = Puzzle.normal.order(created_at: :desc).first | 4 | @normal_puzzle = Puzzle.normal.order(created_at: :desc).first |
5 | @hard_puzzle = Puzzle.hard.order(created_at: :desc).first | 5 | @hard_puzzle = Puzzle.hard.order(created_at: :desc).first |
6 | @expert_puzzle = Puzzle.expert.order(created_at: :desc).first | ||
6 | end | 7 | end |
7 | 8 | ||
8 | def index | 9 | def index |
9 | #@puzzle = WittleGenerator.new.generate_medium | 10 | @puzzles = Puzzle.select(:id, :created_at, :category).order(created_at: :asc).all.chunk { |puzzle| puzzle.created_at.localtime.to_date }.to_h.transform_values { |by_date| by_date.sort_by(&:category).chunk { |puzzle| puzzle.category }.to_h } |
10 | end | 11 | end |
11 | 12 | ||
12 | def show | 13 | def show |