mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 18:26:21 +00:00
feat: almacenar los campos
This commit is contained in:
parent
1444b57161
commit
05be2bb51b
4 changed files with 16 additions and 1 deletions
|
@ -84,6 +84,7 @@ class ApplicationController < ActionController::Base
|
|||
protected
|
||||
|
||||
def configure_permitted_parameters
|
||||
devise_parameter_sanitizer.permit(:sign_up, keys: Usuarie::CONSENT_FIELDS)
|
||||
devise_parameter_sanitizer.permit(:account_update, keys: %i[lang])
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
# Usuarie de la plataforma
|
||||
class Usuarie < ApplicationRecord
|
||||
include Usuarie::Consent
|
||||
|
||||
devise :invitable, :database_authenticatable,
|
||||
:recoverable, :rememberable, :validatable,
|
||||
:confirmable, :lockable, :registerable
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
- if params[:consent]
|
||||
.form-group
|
||||
- %i[privacy_policy_accepted terms_of_service_accepted code_of_conduct_accepted available_for_feedback_accepted].each do |field|
|
||||
- Usuarie::CONSENT_FIELDS.each do |field|
|
||||
- required = t(".#{field}.required", default: '').present?
|
||||
- id = "usuarie_#{field}"
|
||||
- name = "usuarie[#{field}]"
|
||||
|
|
12
db/migrate/20230328200129_add_consent_to_usuaries.rb
Normal file
12
db/migrate/20230328200129_add_consent_to_usuaries.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Agrega consentimientos a les usuaries. No usamos un loop de
|
||||
# Usuarie::CONSENT_FIELDS porque quizás agreguemos campos luego.
|
||||
class AddConsentToUsuaries < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :usuaries, :privacy_policy_accepted_at, :datetime
|
||||
add_column :usuaries, :terms_of_service_accepted_at, :datetime
|
||||
add_column :usuaries, :code_of_conduct_accepted_at, :datetime
|
||||
add_column :usuaries, :available_for_feedback_accepted_at, :datetime
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue