2019-08-19 17:41:47 +02:00
|
|
|
class StaticPagesController < ApplicationController
|
2019-08-26 14:29:56 +02:00
|
|
|
def roadmap
|
2019-08-26 18:19:47 +02:00
|
|
|
@post_statuses = PostStatus
|
|
|
|
|
.select(:id, :name, :color)
|
|
|
|
|
.where(show_in_roadmap: true)
|
|
|
|
|
.order(order: :asc)
|
2019-08-26 14:29:56 +02:00
|
|
|
|
|
|
|
|
@posts = Post
|
|
|
|
|
.select(:id, :title, :board_id, :post_status_id, :user_id, :created_at)
|
|
|
|
|
.where(post_status_id: get_array_of_ids(@post_statuses))
|
2019-08-19 17:41:47 +02:00
|
|
|
end
|
2019-08-26 14:29:56 +02:00
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def get_array_of_ids(resources)
|
|
|
|
|
array_of_ids = []
|
|
|
|
|
resources.each do |resource|
|
|
|
|
|
array_of_ids.push resource.id
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
array_of_ids
|
|
|
|
|
end
|
2019-08-19 17:41:47 +02:00
|
|
|
end
|