moves magic number to Settings
This commit is contained in:
@@ -101,7 +101,7 @@ class Proposal < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.votes_needed_for_success
|
def self.votes_needed_for_success
|
||||||
53726
|
Setting.value_for('votes_for_proposal_success').to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ en:
|
|||||||
official_level_5_name: "Level 5 official positions"
|
official_level_5_name: "Level 5 official positions"
|
||||||
max_ratio_anon_votes_on_debates: "Max allowed percentage of anonymous votes per Debate"
|
max_ratio_anon_votes_on_debates: "Max allowed percentage of anonymous votes per Debate"
|
||||||
max_votes_for_proposal_edit: "Number of votes where a Proposal is not editable anymore"
|
max_votes_for_proposal_edit: "Number of votes where a Proposal is not editable anymore"
|
||||||
proposal_code_prefix: "Prefix for Proposals codes"
|
proposal_code_prefix: "Prefix for Proposals codes"
|
||||||
|
votes_for_proposal_success: "Number of votes needed for Proposal approval"
|
||||||
@@ -7,4 +7,5 @@ es:
|
|||||||
official_level_5_name: "Cargos públicos de nivel 5"
|
official_level_5_name: "Cargos públicos de nivel 5"
|
||||||
max_ratio_anon_votes_on_debates: "Porcentaje máximo de votos anónimos por Debate"
|
max_ratio_anon_votes_on_debates: "Porcentaje máximo de votos anónimos por Debate"
|
||||||
max_votes_for_proposal_edit: "Número de votos en que una Propuesta deja de poderse editar"
|
max_votes_for_proposal_edit: "Número de votos en que una Propuesta deja de poderse editar"
|
||||||
proposal_code_prefix: "Prefijo para los códigos de Propuestas"
|
proposal_code_prefix: "Prefijo para los códigos de Propuestas"
|
||||||
|
votes_for_proposal_success: "Número de votos necesarios para aprobar una Propuesta"
|
||||||
@@ -11,6 +11,7 @@ Setting.create(key: 'official_level_5_name', value: 'Alcaldesa')
|
|||||||
Setting.create(key: 'max_ratio_anon_votes_on_debates', value: '50')
|
Setting.create(key: 'max_ratio_anon_votes_on_debates', value: '50')
|
||||||
Setting.create(key: 'max_votes_for_proposal_edit', value: '1000')
|
Setting.create(key: 'max_votes_for_proposal_edit', value: '1000')
|
||||||
Setting.create(key: 'proposal_code_prefix', value: 'MAD')
|
Setting.create(key: 'proposal_code_prefix', value: 'MAD')
|
||||||
|
Setting.create(key: 'votes_for_proposal_success', value: '100')
|
||||||
|
|
||||||
puts "Creating Users"
|
puts "Creating Users"
|
||||||
|
|
||||||
|
|||||||
@@ -20,3 +20,6 @@ Setting.create(key: 'max_votes_for_proposal_edit', value: '1000')
|
|||||||
|
|
||||||
# Prefix for the Proposal codes
|
# Prefix for the Proposal codes
|
||||||
Setting.create(key: 'proposal_code_prefix', value: 'MAD')
|
Setting.create(key: 'proposal_code_prefix', value: 'MAD')
|
||||||
|
|
||||||
|
# Number of votes needed for proposal success
|
||||||
|
Setting.create(key: 'votes_for_proposal_success', value: '53726')
|
||||||
|
|||||||
Reference in New Issue
Block a user