Models and controllers looks more like Rails

This commit is contained in:
riggraz
2019-09-09 16:50:33 +02:00
parent 46b8f06955
commit 9fcf9bcef9
4 changed files with 21 additions and 10 deletions

View File

@@ -1,12 +1,11 @@
class StaticPagesController < ApplicationController
def roadmap
@post_statuses = PostStatus
.find_roadmap
.select(:id, :name, :color)
.where(show_in_roadmap: true)
.order(order: :asc)
@posts = Post
.find_with_post_status_in(@post_statuses)
.select(:id, :title, :board_id, :post_status_id, :user_id, :created_at)
.where(post_status_id: @post_statuses.pluck(:id))
end
end