I'm currently working on a Rails query that looks like this:
@c = RealEstateAgentAssignmentStatus.joins(:real_estate_agent_assignments =>:loan_application)
.group("real_estate_agent_assignment_statuses.assignment_status").select("real_estate_agent_assignment_statuses.assignment_status,count(real_estate_assignments.loan_application_id)")
.where("real_estate_agent_assignments.real_estate_agent_id = 188").count
After executing the query, I receive the Rails result in JSON format as follows:
var data = {
"Rejected By Customer/Bank":1,
"Failed Screening":2,
"Submitted":2,
"Processing Stage":3
}
The reason for the JSON format is because I need to pass it to AngularJS for further processing.
Currently, I can only access the data like this:
data["Submitted"]
Is there a way to hash the result in Rails or convert it into an array so that I can access it like this:
data.status , data.value
I considered mapping it in Rails, but I encountered an error. Any assistance on this matter would be greatly appreciated. Thank you!