mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 20:26:22 +00:00
Merge branch 'issue-12795' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
26514ee3f8
2 changed files with 34 additions and 0 deletions
26
app/models/concerns/usuarie/consent.rb
Normal file
26
app/models/concerns/usuarie/consent.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Usuarie
|
||||
# Gestiona los campos de consentimiento
|
||||
module Consent
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
CONSENT_FIELDS = %i[privacy_policy_accepted terms_of_service_accepted code_of_conduct_accepted available_for_feedback_accepted]
|
||||
|
||||
CONSENT_FIELDS.each do |field|
|
||||
attribute field, :boolean
|
||||
end
|
||||
|
||||
before_save :update_consent_fields!
|
||||
|
||||
private
|
||||
|
||||
def update_consent_fields!
|
||||
CONSENT_FIELDS.each do |field|
|
||||
send(:"#{field}_at=", Time.now) if send(field).present?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Elimina un campo que nunca se usó
|
||||
class RemoveAceptaPoliticasDePrivacidadFromUsuaries < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
remove_column :usuaries, :acepta_politicas_de_privacidad, :boolean, default: false
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue