mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
23 lines
546 B
Ruby
23 lines
546 B
Ruby
class StaticPagesController < ApplicationController
|
|
def roadmap
|
|
@post_statuses = PostStatus
|
|
.select(:id, :name, :color)
|
|
.where(show_in_roadmap: true)
|
|
.order(order: :asc)
|
|
|
|
@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 |