diff --git a/app/controllers/proposals_dashboard_controller.rb b/app/controllers/proposals_dashboard_controller.rb index 12034a86a..b2de07c6a 100644 --- a/app/controllers/proposals_dashboard_controller.rb +++ b/app/controllers/proposals_dashboard_controller.rb @@ -4,7 +4,7 @@ class ProposalsDashboardController < ApplicationController before_action :authenticate_user! - helper_method :proposal, :proposed_actions, :proposal_dashboard_action + helper_method :proposal, :proposed_actions, :resources, :proposal_dashboard_action respond_to :html layout 'proposals_dashboard' @@ -76,4 +76,8 @@ class ProposalsDashboardController < ApplicationController def proposed_actions @proposed_actions ||= ProposalDashboardAction.proposed_actions.active_for(proposal) end + + def resources + @resources ||= ProposalDashboardAction.resources.active_for(proposal) + end end diff --git a/app/models/proposal_dashboard_action.rb b/app/models/proposal_dashboard_action.rb index bc843ee1a..6e7e7f60d 100644 --- a/app/models/proposal_dashboard_action.rb +++ b/app/models/proposal_dashboard_action.rb @@ -44,8 +44,8 @@ class ProposalDashboardAction < ActiveRecord::Base scope :active, -> { where(active: true) } scope :inactive, -> { where(active: false) } - scope :resources, -> { where(action_type: 'resource') } - scope :proposed_actions, -> { where(action_type: 'proposed_action') } + scope :resources, -> { where(action_type: 1) } + scope :proposed_actions, -> { where(action_type: 0) } scope :active_for, ->(proposal) do published_at = proposal.published_at&.to_date || Date.today diff --git a/app/views/proposals_dashboard/_menu.html.erb b/app/views/proposals_dashboard/_menu.html.erb index f9871ef50..1efcab290 100644 --- a/app/views/proposals_dashboard/_menu.html.erb +++ b/app/views/proposals_dashboard/_menu.html.erb @@ -75,13 +75,13 @@ -<% if proposed_actions.resources.any? %> +<% if resources.any? %>