Skip to content

Commit

Permalink
Merge pull request #962 from PlanoramaEvents/plan-891-demographic-fields
Browse files Browse the repository at this point in the history
PLAN-891 add server side support for the new demographic linked fields
  • Loading branch information
Gailbear authored Feb 24, 2024
2 parents cede558 + f79a2c4 commit 785ecda
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 248 deletions.
3 changes: 3 additions & 0 deletions app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ def allowed_params
is_local
languages_fluent_in
demographic_categories
excluded_demographic_categories
global_diaspora
non_anglophone
age_at_convention
romantic_sexual_orientation
needs_accommodations
Expand Down
166 changes: 84 additions & 82 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,90 @@
#
# Table name: people
#
# id :uuid not null, primary key
# accommodations :string(10000)
# age_at_convention :string
# attendance_type :string(200)
# availability_notes :string
# bio :text
# black_diaspora :string(10000)
# can_photo :enum default("no")
# can_photo_exceptions :string(10000)
# can_record :enum default("no")
# can_record_exceptions :string(10000)
# can_share :boolean default(FALSE), not null
# can_stream :enum default("no")
# can_stream_exceptions :string(10000)
# comments :text
# con_state :enum default("not_set")
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# date_reg_synced :datetime
# demographic_categories :string
# do_not_assign_with :string(10000)
# encrypted_password :string default(""), not null
# ethnicity :string(400)
# facebook :string
# failed_attempts :integer default(0), not null
# flickr :string
# gender :string(400)
# indigenous :string(10000)
# instagram :string
# integrations :jsonb not null
# is_local :boolean default(FALSE)
# job_title :string
# language :string(5) default("")
# languages_fluent_in :string(10000)
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# linkedin :string
# lock_version :integer default(0)
# locked_at :datetime
# moderation_experience :string(10000)
# name :string default("")
# name_sort_by :string
# name_sort_by_confirmed :boolean default(FALSE)
# needs_accommodations :boolean default(FALSE)
# non_us_centric_perspectives :string(10000)
# opted_in :boolean default(FALSE), not null
# organization :string
# othered :string(10000)
# othersocialmedia :string
# pronouns :string(400)
# pseudonym :string
# pseudonym_sort_by :string
# pseudonym_sort_by_confirmed :boolean default(FALSE)
# published_name :string
# published_name_sort_by :string
# reddit :string
# registered :boolean default(FALSE), not null
# registration_number :string
# registration_type :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# romantic_sexual_orientation :string
# sign_in_count :integer default(0), not null
# tiktok :string
# timezone :string(500)
# twelve_hour :boolean default(TRUE)
# twitch :string
# twitter :string
# unconfirmed_email :string
# unlock_token :string
# website :string
# willing_to_moderate :boolean default(FALSE)
# year_of_birth :integer
# youtube :string
# created_at :datetime not null
# updated_at :datetime not null
# reg_id :string
# id :uuid not null, primary key
# accommodations :string(10000)
# age_at_convention :string
# attendance_type :string(200)
# availability_notes :string
# bio :text
# black_diaspora :string(10000)
# can_photo :enum default("no")
# can_photo_exceptions :string(10000)
# can_record :enum default("no")
# can_record_exceptions :string(10000)
# can_share :boolean default(FALSE), not null
# can_stream :enum default("no")
# can_stream_exceptions :string(10000)
# comments :text
# con_state :enum default("not_set")
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# date_reg_synced :datetime
# demographic_categories :string
# do_not_assign_with :string(10000)
# encrypted_password :string default(""), not null
# ethnicity :string(400)
# excluded_demographic_categories :string
# facebook :string
# failed_attempts :integer default(0), not null
# flickr :string
# gender :string(400)
# global_diaspora :string
# indigenous :string(10000)
# instagram :string
# integrations :jsonb not null
# is_local :boolean default(FALSE)
# job_title :string
# language :string(5) default("")
# languages_fluent_in :string(10000)
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# linkedin :string
# lock_version :integer default(0)
# locked_at :datetime
# moderation_experience :string(10000)
# name :string default("")
# name_sort_by :string
# name_sort_by_confirmed :boolean default(FALSE)
# needs_accommodations :boolean default(FALSE)
# non_anglophone :string
# non_us_centric_perspectives :string(10000)
# opted_in :boolean default(FALSE), not null
# organization :string
# othered :string(10000)
# othersocialmedia :string
# pronouns :string(400)
# pseudonym :string
# pseudonym_sort_by :string
# pseudonym_sort_by_confirmed :boolean default(FALSE)
# published_name :string
# published_name_sort_by :string
# reddit :string
# registered :boolean default(FALSE), not null
# registration_number :string
# registration_type :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# romantic_sexual_orientation :string
# sign_in_count :integer default(0), not null
# tiktok :string
# timezone :string(500)
# twelve_hour :boolean default(TRUE)
# twitch :string
# twitter :string
# unconfirmed_email :string
# unlock_token :string
# website :string
# willing_to_moderate :boolean default(FALSE)
# year_of_birth :integer
# youtube :string
# created_at :datetime not null
# updated_at :datetime not null
# reg_id :string
#
# Indexes
#
Expand All @@ -94,7 +97,6 @@
# index_people_on_reset_password_token (reset_password_token) UNIQUE
# index_people_on_unlock_token (unlock_token) UNIQUE
#
#
class Person < ApplicationRecord
# Include default devise modules. Others available are:
devise :database_authenticatable,
Expand Down
17 changes: 16 additions & 1 deletion app/serializers/curated_tag_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# == Schema Information
#
# Table name: curated_tags
#
# id :uuid not null, primary key
# context :string(190)
# lock_version :integer
# name :string(190)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# idx_tagname_on_context (name,context) UNIQUE
#
class CuratedTagSerializer
include JSONAPI::Serializer

attributes :name, :id, :context, :lock_version
end
end
170 changes: 88 additions & 82 deletions app/serializers/person_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,90 @@
#
# Table name: people
#
# id :uuid not null, primary key
# accommodations :string(10000)
# age_at_convention :string
# attendance_type :string(200)
# availability_notes :string
# bio :text
# black_diaspora :string(10000)
# can_photo :enum default("no")
# can_photo_exceptions :string(10000)
# can_record :enum default("no")
# can_record_exceptions :string(10000)
# can_share :boolean default(FALSE), not null
# can_stream :enum default("no")
# can_stream_exceptions :string(10000)
# comments :text
# con_state :enum default("not_set")
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# date_reg_synced :datetime
# demographic_categories :string
# do_not_assign_with :string(10000)
# encrypted_password :string default(""), not null
# ethnicity :string(400)
# facebook :string
# failed_attempts :integer default(0), not null
# flickr :string
# gender :string(400)
# indigenous :string(10000)
# instagram :string
# integrations :jsonb not null
# is_local :boolean default(FALSE)
# job_title :string
# language :string(5) default("")
# languages_fluent_in :string(10000)
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# linkedin :string
# lock_version :integer default(0)
# locked_at :datetime
# moderation_experience :string(10000)
# name :string default("")
# name_sort_by :string
# name_sort_by_confirmed :boolean default(FALSE)
# needs_accommodations :boolean default(FALSE)
# non_us_centric_perspectives :string(10000)
# opted_in :boolean default(FALSE), not null
# organization :string
# othered :string(10000)
# othersocialmedia :string
# pronouns :string(400)
# pseudonym :string
# pseudonym_sort_by :string
# pseudonym_sort_by_confirmed :boolean default(FALSE)
# published_name :string
# published_name_sort_by :string
# reddit :string
# registered :boolean default(FALSE), not null
# registration_number :string
# registration_type :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# romantic_sexual_orientation :string
# sign_in_count :integer default(0), not null
# tiktok :string
# timezone :string(500)
# twelve_hour :boolean default(TRUE)
# twitch :string
# twitter :string
# unconfirmed_email :string
# unlock_token :string
# website :string
# willing_to_moderate :boolean default(FALSE)
# year_of_birth :integer
# youtube :string
# created_at :datetime not null
# updated_at :datetime not null
# reg_id :string
# id :uuid not null, primary key
# accommodations :string(10000)
# age_at_convention :string
# attendance_type :string(200)
# availability_notes :string
# bio :text
# black_diaspora :string(10000)
# can_photo :enum default("no")
# can_photo_exceptions :string(10000)
# can_record :enum default("no")
# can_record_exceptions :string(10000)
# can_share :boolean default(FALSE), not null
# can_stream :enum default("no")
# can_stream_exceptions :string(10000)
# comments :text
# con_state :enum default("not_set")
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# date_reg_synced :datetime
# demographic_categories :string
# do_not_assign_with :string(10000)
# encrypted_password :string default(""), not null
# ethnicity :string(400)
# excluded_demographic_categories :string
# facebook :string
# failed_attempts :integer default(0), not null
# flickr :string
# gender :string(400)
# global_diaspora :string
# indigenous :string(10000)
# instagram :string
# integrations :jsonb not null
# is_local :boolean default(FALSE)
# job_title :string
# language :string(5) default("")
# languages_fluent_in :string(10000)
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# linkedin :string
# lock_version :integer default(0)
# locked_at :datetime
# moderation_experience :string(10000)
# name :string default("")
# name_sort_by :string
# name_sort_by_confirmed :boolean default(FALSE)
# needs_accommodations :boolean default(FALSE)
# non_anglophone :string
# non_us_centric_perspectives :string(10000)
# opted_in :boolean default(FALSE), not null
# organization :string
# othered :string(10000)
# othersocialmedia :string
# pronouns :string(400)
# pseudonym :string
# pseudonym_sort_by :string
# pseudonym_sort_by_confirmed :boolean default(FALSE)
# published_name :string
# published_name_sort_by :string
# reddit :string
# registered :boolean default(FALSE), not null
# registration_number :string
# registration_type :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# romantic_sexual_orientation :string
# sign_in_count :integer default(0), not null
# tiktok :string
# timezone :string(500)
# twelve_hour :boolean default(TRUE)
# twitch :string
# twitter :string
# unconfirmed_email :string
# unlock_token :string
# website :string
# willing_to_moderate :boolean default(FALSE)
# year_of_birth :integer
# youtube :string
# created_at :datetime not null
# updated_at :datetime not null
# reg_id :string
#
# Indexes
#
Expand Down Expand Up @@ -138,7 +141,10 @@ class PersonSerializer #< ActiveModel::Serializer
:twelve_hour,
:attendance_type,
:availability_notes,
:integrations
:integrations,
:excluded_demographic_categories,
:global_diaspora,
:non_anglophone

# status and comments hidden except for staff
protected_attributes :con_state, :comments
Expand Down
Loading

0 comments on commit 785ecda

Please sign in to comment.