Class: Subject
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Subject
- Includes:
- PgSearch, SubjectSearchable
- Defined in:
- api/app/models/subject.rb
Overview
A consumer They can participate in data collection mechanisms can self-direct data collection if invited to the client portal.
Schema:
- [Integer]
company_id
, null: false - [String]
city
- [String]
email
- [String]
phone
- [String]
code
- [DateTime]
archived_at
- [String]
work_phone
- [String]
mobile_phone
- [Text]
notes
- [String]
first_name
- [String]
last_name
- [String]
middle_initial
- [String]
preferred_language
, default: 'en_US' - [Date]
date_of_birth
- [String]
profile_picture_file_name
- [String]
profile_picture_content_type
- [Integer]
profile_picture_file_size
- [DateTime]
profile_picture_updated_at
- [Integer]
invitations_count
, default: 0 - [String]
external_id
- [DateTime]
last_participated_at
- [DateTime]
onboarding_completed_at
- [DateTime]
created_at
, null: false - [DateTime]
updated_at
, null: false - [Integer]
household_id
, null: false - [Boolean]
head_of_household
, null: false - [Integer]
email_standing
, default: 1, null: false - [DateTime]
email_changed_at
- [DateTime]
age_verified_at
- [Date]
contact_exclusion_until_date
- [DateTime]
deleted_at
- [Decimal]
interaction_rating
, default: 5.0, null: false - [Decimal]
engagement_rating
, default: 5.0, null: false - [DateTime]
rated_at
- [Integer]
current_subject_consent_response_id
- [Boolean]
consented
- [Boolean]
can_call
- [Boolean]
can_email
- [Integer]
account_id
- [Boolean]
portal_access
, default: false - [String]
link_token
- [DateTime]
link_created_at
- [DateTime]
link_sent_at
- [DateTime]
link_accepted_at
- [Integer]
link_account_id
- [Integer]
link_by_id
- [String]
link_by_type
- [Integer]
email_status
, default: 0, null: false - [String]
name
, null: false - [DateTime]
minor_entry_completed_at
- [DateTime]
interests_selected_at
Constant Summary collapse
- ADULT_AGE =
18
Instance Attribute Summary collapse
-
#cid ⇒ Object
used by the export.
-
#current_user ⇒ Object
used by the export.
-
#participant_count ⇒ Object
used by the export.
-
#skip_for_import ⇒ Object
used by the export.
Instance Method Summary collapse
- #accepted_terms_of_service ⇒ Object
- #active? ⇒ Boolean
- #age(now = DateTime.current) ⇒ Object
- #age_at(age_date) ⇒ Object
- #anonymous? ⇒ Boolean
- #archive_and_unschedule ⇒ Object
- #assign_onboarding(onboarding_id) ⇒ Object
- #can?(_permission) ⇒ Boolean
- #can_call_description ⇒ Object
- #can_email_description ⇒ Object
- #can_overfill_sessions? ⇒ Boolean
- #clean_conflicting_non_exclusive_demographics(demographic_ids) ⇒ Object
- #confirm_profile ⇒ Object
- #consent_status ⇒ Object
- #consented_description ⇒ Object
- #contactable? ⇒ Boolean
- #full_name ⇒ Object
- #get_email_status ⇒ Object
- #guardian? ⇒ Boolean
- #has_login_account ⇒ Object
- #history(start_date, end_date = DateTime.current) ⇒ Object
- #housemates ⇒ Object
- #interaction_counts ⇒ Object
- #interest_progress ⇒ Object
- #interest_selection_status(company, recruiting_defaults) ⇒ Object
- #minor? ⇒ Boolean (also: #is_minor)
- #missed_required_categories(dcs) ⇒ Object
- #next_onboarding_for_category(demographic_category_id, current_onboarding_configuration_id = nil) ⇒ Object
- #nullable_boolean_decision_description(field) ⇒ Object
- #onboarding_for_category(demographic_category_id) ⇒ Object
- #pending_minor_entry?(recruiting_defaults) ⇒ Boolean
-
#pending_onboarding(recruiting_defaults = company.meta.data['defaults']['recruiting']) ⇒ Object
update_column :email_standing, (standing || Subject.email_standings[:valid_email]) end.
- #pending_onboarding_for_category(demographic_category_id) ⇒ Object
- #progress(subject_interaction_id = nil) ⇒ Object
- #red_jade_admin ⇒ Object
- #redact ⇒ Object
- #roles ⇒ Object (also: #clearance_levels)
- #set_email_status ⇒ Object
- #set_name ⇒ Object
- #subject_acting? ⇒ Boolean
- #was_guardian? ⇒ Boolean
Methods included from SubjectSearchable
Instance Attribute Details
#cid ⇒ Object
used by the export
#current_user ⇒ Object
used by the export
#participant_count ⇒ Object
used by the export
#skip_for_import ⇒ Object
used by the export
Instance Method Details
#accepted_terms_of_service ⇒ Object
#active? ⇒ Boolean
#age(now = DateTime.current) ⇒ Object
#age_at(age_date) ⇒ Object
#anonymous? ⇒ Boolean
#archive_and_unschedule ⇒ Object
#assign_onboarding(onboarding_id) ⇒ Object
#can?(_permission) ⇒ Boolean
#can_call_description ⇒ Object
#can_email_description ⇒ Object
#can_overfill_sessions? ⇒ Boolean
#clean_conflicting_non_exclusive_demographics(demographic_ids) ⇒ Object
#confirm_profile ⇒ Object
#consent_status ⇒ Object
#consented_description ⇒ Object
#contactable? ⇒ Boolean
#full_name ⇒ Object
#get_email_status ⇒ Object
#guardian? ⇒ Boolean
#has_login_account ⇒ Object
#history(start_date, end_date = DateTime.current) ⇒ Object
#housemates ⇒ Object
#interaction_counts ⇒ Object
#interest_progress ⇒ Object
#interest_selection_status(company, recruiting_defaults) ⇒ Object
#minor? ⇒ Boolean Also known as: is_minor
#missed_required_categories(dcs) ⇒ Object
#next_onboarding_for_category(demographic_category_id, current_onboarding_configuration_id = nil) ⇒ Object
#nullable_boolean_decision_description(field) ⇒ Object
#onboarding_for_category(demographic_category_id) ⇒ Object
#pending_minor_entry?(recruiting_defaults) ⇒ Boolean
#pending_onboarding(recruiting_defaults = company.meta.data['defaults']['recruiting']) ⇒ Object
update_column :email_standing, (standing || Subject.email_standings[:valid_email]) end