@@ -15,7 +15,7 @@ def todays_activity_data
1515 if params [ :school_id ]
1616 where_filter = { school_id : params [ :school_id ] }
1717 else
18- types << "Non-Applied Users "
18+ types << "Incomplete Applications "
1919 end
2020 render json : activity_chart_data ( types , "hour" , Time . zone . today . beginning_of_day ..Time . zone . today . end_of_day , where_filter )
2121 end
@@ -26,7 +26,7 @@ def todays_stats_data
2626 "Applications" => Questionnaire . where ( "created_at >= :date_min" , date_min : date_min ) . count ,
2727 "Confirmations" => Questionnaire . where ( "acc_status = \" rsvp_confirmed\" AND acc_status_date >= :date_min" , date_min : date_min ) . count ,
2828 "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 ,
3030 }
3131 end
3232
@@ -43,16 +43,16 @@ def confirmation_activity_data
4343 end
4444
4545 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 )
4747 end
4848
4949 def user_distribution_data
5050 total_stats_data = { }
5151 total_count = Questionnaire . count
5252 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
5656 render json : total_stats_data
5757 end
5858
@@ -116,22 +116,22 @@ def activity_chart_data(types, group_type, range, where_filter = nil)
116116 case type
117117 when "Applications"
118118 data = Questionnaire . send ( "group_by_#{ group_type } " , :created_at , range : range )
119- when "RIT Applications"
119+ when "Home Applications"
120120 data = Questionnaire . where ( "school_id = \" 2304\" " ) . send ( "group_by_#{ group_type } " , :created_at , range : range )
121- when "Non-RIT Applications"
121+ when "Away Applications"
122122 data = Questionnaire . where ( "school_id != \" 2304\" " ) . send ( "group_by_#{ group_type } " , :created_at , range : range )
123123 when "Confirmations"
124124 data = Questionnaire . where ( acc_status : "rsvp_confirmed" ) . send ( "group_by_#{ group_type } " , :acc_status_date , range : range )
125125 when "Denials"
126126 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 "
128128 data = User . without_questionnaire . send ( "group_by_#{ group_type } " , "users.created_at" , range : range )
129129 when "Checked In"
130130 data = Questionnaire . where ( "checked_in_at > 0" ) . send ( "group_by_#{ group_type } " , :checked_in_at , range : range )
131131 when "Boarded Bus"
132132 data = Questionnaire . where ( "boarded_bus_at > 0" ) . send ( "group_by_#{ group_type } " , :boarded_bus_at , range : range )
133133 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 "
135135 chart_data << { name : type , data : data . count }
136136 end
137137 chart_data
0 commit comments