Files
astuto/app/controllers/static_pages_controller.rb
2019-08-26 14:29:56 +02:00

20 lines
477 B
Ruby

class StaticPagesController < ApplicationController
def roadmap
@post_statuses = PostStatus.select(:id, :name, :color)
@posts = Post
.select(:id, :title, :board_id, :post_status_id, :user_id, :created_at)
.where(post_status_id: get_array_of_ids(@post_statuses))
end
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
end