Class: Subject

Inherits:
ApplicationRecord
  • Object
show all
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

Instance Method Summary collapse

Methods included from SubjectSearchable

#demographic_ids_for_campaign

Instance Attribute Details

#cidObject

used by the export

#current_userObject

used by the export

#participant_countObject

used by the export

#skip_for_importObject

used by the export

Instance Method Details

#accepted_terms_of_serviceObject

#active?Boolean

Returns:

  • (Boolean)

#age(now = DateTime.current) ⇒ Object

#age_at(age_date) ⇒ Object

#anonymous?Boolean

Returns:

  • (Boolean)

#archive_and_unscheduleObject

#assign_onboarding(onboarding_id) ⇒ Object

#can?(_permission) ⇒ Boolean

Returns:

  • (Boolean)

#can_call_descriptionObject

#can_email_descriptionObject

#can_overfill_sessions?Boolean

Returns:

  • (Boolean)

#clean_conflicting_non_exclusive_demographics(demographic_ids) ⇒ Object

#confirm_profileObject

#consented_descriptionObject

#contactable?Boolean

Returns:

  • (Boolean)

#full_nameObject

#get_email_statusObject

#guardian?Boolean

Returns:

  • (Boolean)

#has_login_accountObject

#history(start_date, end_date = DateTime.current) ⇒ Object

#housematesObject

#interaction_countsObject

#interest_progressObject

#interest_selection_status(company, recruiting_defaults) ⇒ Object

#minor?Boolean Also known as: is_minor

Returns:

  • (Boolean)

#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

Returns:

  • (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_adminObject

#redactObject

#rolesObject Also known as: clearance_levels

#set_email_statusObject

#set_nameObject

#subject_acting?Boolean

Returns:

  • (Boolean)

#was_guardian?Boolean

Returns:

  • (Boolean)