John fix issue#274 (#275)

* <fixed privacy policy errors>

* <Fixed code style>

* <Robustness changes>

* <redirect to 404 page if terms are disabled>

* <patched validation of accepted terms>

* <relaunching scrutinizer>
This commit is contained in:
John Ma
2018-10-02 10:23:09 -04:00
committed by Jesus Federico
parent 423ec6c828
commit dcd24d61be
4 changed files with 14 additions and 7 deletions

View File

@ -35,7 +35,8 @@ class User < ApplicationRecord
validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?, on: :create
# Bypass validation if omniauth
validates :accepted_terms, acceptance: true, unless: proc { !greenlight_account? }
validates :accepted_terms, acceptance: true,
unless: -> { !greenlight_account? || !Rails.configuration.terms }
# We don't want to require password validations on all accounts.
has_secure_password(validations: false)