Create scope by_proposal
Add to active_for class method and to active_resources controller method the new scope by_proposal. - Published proposal: display all actions. - Draft proposal: only display actions for draft proposals.
This commit is contained in:
@@ -11,8 +11,8 @@ class DashboardController < Dashboard::BaseController
|
||||
proposal.publish
|
||||
redirect_to proposal_dashboard_path(proposal), notice: t('proposals.notice.published')
|
||||
end
|
||||
|
||||
def progress
|
||||
|
||||
def progress
|
||||
authorize! :dashboard, proposal
|
||||
end
|
||||
|
||||
@@ -21,9 +21,12 @@ class DashboardController < Dashboard::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def active_resources
|
||||
@active_resources ||= Dashboard::Action.active.resources.order(required_supports: :asc, day_offset: :asc)
|
||||
@active_resources ||= Dashboard::Action.active
|
||||
.resources
|
||||
.by_proposal(proposal)
|
||||
.order(required_supports: :asc, day_offset: :asc)
|
||||
end
|
||||
|
||||
def course
|
||||
|
||||
Reference in New Issue
Block a user