Class: DemographicCategory
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- DemographicCategory
- Includes:
- PgSearch
- Defined in:
- api/app/models/demographic_category.rb
Overview
A category of information about a subject
- [String]
name - [Integer]
created_by_id - [Datetime]
created_at - [Datetime]
updated_at - [Integer]
sensory_test_id - [Integer]
company_id, null: false - [Integer]
source_id- when a test category is created by selecting a company-wide "global" category (i.e. has a NULL sensory_test_id), it receives a source_id pointing to its originator, useful for syncing study-level data back up to the subject - [Boolean]
exclusive, default: true, null: false - [Integer]
category_type, default: 0 - [Datetime]
age_date
Category Types
- user_defined - just a name
- age - represents age ranges, for example
1-10,11-20,21-30, which a subject then matches based on theirdate_of_birth - household_size - represents household member count ranges, for example
1-2,3-4,5-20, which a subject then matches based on their household's subject count.
Instance Attribute Summary collapse
Instance Method Summary collapse
- #calculate_age(dob) ⇒ Object
- #process_demographics(current_user, all_demographics, demographic_category) ⇒ Object
- #range? ⇒ Boolean
- #reassign_range_demographics ⇒ Object