Merge branch 'budgets-baltasar' of github.com:consul/consul into budgets-baltasar
This commit is contained in:
@@ -17,7 +17,7 @@ module Budgets
|
||||
feature_flag :budgets
|
||||
|
||||
has_orders %w{most_voted newest oldest}, only: :show
|
||||
has_orders ->(c){ c.instance_variable_get(:@budget).balloting? ? %w{random price} : %w{random confidence_score} }, only: :index
|
||||
has_orders ->(c) { c.instance_variable_get(:@budget).investments_orders }, only: :index
|
||||
|
||||
invisible_captcha only: [:create, :update], honeypot: :subtitle, scope: :budget_investment
|
||||
|
||||
|
||||
@@ -94,6 +94,17 @@ class Budget < ActiveRecord::Base
|
||||
formatted_amount(amount_spent(heading))
|
||||
end
|
||||
|
||||
def investments_orders
|
||||
case phase
|
||||
when 'accepting', 'reviewing'
|
||||
%w{random}
|
||||
when 'balloting', 'reviewing_ballots'
|
||||
%w{random price}
|
||||
else
|
||||
%w{random confidence_score}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sanitize_descriptions
|
||||
|
||||
Reference in New Issue
Block a user