@@ -15,7 +15,7 @@ def todays_activity_data
15
15
if params [ :school_id ]
16
16
where_filter = { school_id : params [ :school_id ] }
17
17
else
18
- types << "Non-Applied Users "
18
+ types << "Incomplete Applications "
19
19
end
20
20
render json : activity_chart_data ( types , "hour" , Time . zone . today . beginning_of_day ..Time . zone . today . end_of_day , where_filter )
21
21
end
@@ -26,7 +26,7 @@ def todays_stats_data
26
26
"Applications" => Questionnaire . where ( "created_at >= :date_min" , date_min : date_min ) . count ,
27
27
"Confirmations" => Questionnaire . where ( "acc_status = \" rsvp_confirmed\" AND acc_status_date >= :date_min" , date_min : date_min ) . count ,
28
28
"Denials" => Questionnaire . where ( "acc_status = \" rsvp_denied\" AND acc_status_date >= :date_min" , date_min : date_min ) . count ,
29
- "Non-Applied Users " => User . without_questionnaire . where ( "users.created_at >= :date_min" , date_min : date_min ) . count
29
+ "Incomplete Applications " => User . without_questionnaire . where ( "users.created_at >= :date_min" , date_min : date_min ) . count ,
30
30
}
31
31
end
32
32
@@ -43,16 +43,16 @@ def confirmation_activity_data
43
43
end
44
44
45
45
def application_activity_data
46
- render json : activity_chart_data ( [ "Non-RIT Applications" , "RIT Applications" , "Non-Applied Users " ] , "day" , 3 . week . ago ..Time . zone . now )
46
+ render json : activity_chart_data ( [ "Away Applications" , "Home Applications" , "Incomplete Applications " ] , "day" , 3 . week . ago ..Time . zone . now )
47
47
end
48
48
49
49
def user_distribution_data
50
50
total_stats_data = { }
51
51
total_count = Questionnaire . count
52
52
rit_count = Questionnaire . where ( "school_id = \" 2304\" " ) . count
53
- total_stats_data [ "Non-Applied Users " ] = User . without_questionnaire . count
54
- total_stats_data [ "Non-RIT Applications" ] = total_count - rit_count
55
- total_stats_data [ "RIT Applications" ] = rit_count
53
+ total_stats_data [ "Incomplete Applications " ] = User . without_questionnaire . count
54
+ total_stats_data [ "Away Applications" ] = total_count - rit_count
55
+ total_stats_data [ "Home Applications" ] = rit_count
56
56
render json : total_stats_data
57
57
end
58
58
@@ -116,22 +116,22 @@ def activity_chart_data(types, group_type, range, where_filter = nil)
116
116
case type
117
117
when "Applications"
118
118
data = Questionnaire . send ( "group_by_#{ group_type } " , :created_at , range : range )
119
- when "RIT Applications"
119
+ when "Home Applications"
120
120
data = Questionnaire . where ( "school_id = \" 2304\" " ) . send ( "group_by_#{ group_type } " , :created_at , range : range )
121
- when "Non-RIT Applications"
121
+ when "Away Applications"
122
122
data = Questionnaire . where ( "school_id != \" 2304\" " ) . send ( "group_by_#{ group_type } " , :created_at , range : range )
123
123
when "Confirmations"
124
124
data = Questionnaire . where ( acc_status : "rsvp_confirmed" ) . send ( "group_by_#{ group_type } " , :acc_status_date , range : range )
125
125
when "Denials"
126
126
data = Questionnaire . where ( acc_status : "rsvp_denied" ) . send ( "group_by_#{ group_type } " , :acc_status_date , range : range )
127
- when "Non-Applied Users "
127
+ when "Incomplete Applications "
128
128
data = User . without_questionnaire . send ( "group_by_#{ group_type } " , "users.created_at" , range : range )
129
129
when "Checked In"
130
130
data = Questionnaire . where ( "checked_in_at > 0" ) . send ( "group_by_#{ group_type } " , :checked_in_at , range : range )
131
131
when "Boarded Bus"
132
132
data = Questionnaire . where ( "boarded_bus_at > 0" ) . send ( "group_by_#{ group_type } " , :boarded_bus_at , range : range )
133
133
end
134
- data = data . where ( where_filter ) if where_filter && type != "Non-Applied Users "
134
+ data = data . where ( where_filter ) if where_filter && type != "Incomplete Applications "
135
135
chart_data << { name : type , data : data . count }
136
136
end
137
137
chart_data
0 commit comments