Class: RecruitingCampaign
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- RecruitingCampaign
- Includes:
- PgSearch
- Defined in:
- api/app/models/recruiting_campaign.rb
Overview
Used to recruit subjects for one or more events. Contact (email, phone, portal), filter, screen, quota and schedule subjects
Example serializer
{
"id": 11,
"event_id": 10,
"sensory_test_id": null,
"project_id": null,
"created_by_id": 1,
"created_at": "2020-05-08T00:18:24.699Z",
"progress": {
"detail": "valid",
"quotas": "invalid",
"screener": "invalid",
"summary": "invalid"
},
"participation_frequency": null,
"name": "Conflicty: minestrone: Hub Ned",
"location_id": null,
"location_address": null,
"location_name": null,
"location_city": null,
"location_state": null,
"location_zip": null,
"location_timezone_id": "Europe/London",
"required_session_count": null,
"matches": null,
"event_start_date": null,
"event_end_date": null,
"event_compensation": "0.00",
"description": null,
"call_frequency": 1440,
"blast_frequency": 1440,
"launched_at": "2020-05-14T21:29:17.308Z",
"archived_at": null,
"using_screener": true,
"subjects_can_screen": true,
"allow_anonymous_access": true,
"token": "minestrone",
"disable_scheduling": false,
"exclude_panelists": true,
"exclude_anonymous_dependents": true,
"project_name": null,
"in_future": false,
"quota_factor": "1.5",
"engagement_factor": "1.0",
"interaction_factor": "1.3",
"event_name": ": ",
"event_language": null,
"meta": {
"scripts": {}
},
"time_format": "24hour",
"date_format": "mm/dd/yy",
"location_type": null,
"checkin_type": null,
"campaign_url": "http://my.redjade.localhost/secure/rj/qualify/minestrone"
}
Class Method Summary collapse
Instance Method Summary collapse
- #any_almost_maxed_out_quotas? ⇒ Boolean
- #campaign_url ⇒ Object
- #copy_confirmation_emails(recruiting_campaign_id = nil) ⇒ Object
- #copy_session_reminders(recruiting_campaign_id = nil) ⇒ Object
-
#display_name ⇒ Object
def progress detail = 'valid' # this campaign exists quotas = self.quotas && self.quotas.any? ? 'valid' : 'invalid' screener = questionnaires.any? || !using_screener ? 'valid' : 'invalid' { detail: detail, quotas: quotas, screener: screener, summary: (detail == 'valid' && quotas == 'valid' && screener == 'valid') ? 'valid' : 'invalid' } end.
Class Method Details
.archive_for_project(project_id) ⇒ Object
.cleanup ⇒ Object
Instance Method Details
#any_almost_maxed_out_quotas? ⇒ Boolean
#campaign_url ⇒ Object
#copy_confirmation_emails(recruiting_campaign_id = nil) ⇒ Object
#copy_session_reminders(recruiting_campaign_id = nil) ⇒ Object
#display_name ⇒ Object
def progress detail = 'valid' # this campaign exists quotas = self.quotas && self.quotas.any? ? 'valid' : 'invalid' screener = questionnaires.any? || !using_screener ? 'valid' : 'invalid' { detail: detail, quotas: quotas, screener: screener, summary: (detail == 'valid' && quotas == 'valid' && screener == 'valid') ? 'valid' : 'invalid' } end