adds Setting: minimum age to participate

This commit is contained in:
Juanjo Bazán
2017-01-09 16:04:49 +01:00
parent c5278bfb3b
commit 220e7397e1
4 changed files with 7 additions and 0 deletions

View File

@@ -196,6 +196,10 @@ class User < ActiveRecord::Base
@@username_max_length ||= self.columns.find { |c| c.name == 'username' }.limit || 60
end
def self.minimum_required_age
(Setting['min_age_to_participate'] || 16).to_i
end
def show_welcome_screen?
sign_in_count == 1 && unverified? && !organization && !administrator?
end

View File

@@ -37,3 +37,4 @@ en:
meta_description: "Site description (SEO)"
meta_keywords: "Keywords (SEO)"
verification_offices_url: Verification offices URL
min_age_to_participate: Minimum age needed to participate

View File

@@ -37,3 +37,4 @@ es:
meta_description: "Descripción del sitio (SEO)"
meta_keywords: "Palabras clave (SEO)"
verification_offices_url: URL oficinas verificación
min_age_to_participate: Edad mínima para participar

View File

@@ -94,3 +94,4 @@ Setting['mailer_from_address'] = 'noreply@consul.dev'
# Verification settings
Setting['verification_offices_url'] = 'http://oficinas-atencion-ciudadano.url/'
Setting['min_age_to_participate'] = 16