I’m attempting to write a site in Rails where a user in a manufacturing plant can see what devices are failing. The program storing the alarm data stores one entry when a device faults, and then stores another entry when the device gets fixed. The entries are linked only by having the same value in the EventAssociationID column. How might I write a named scope in Rails to check which faults have been fixed and which ones haven’t?
I’m attempting to write a site in Rails where a user in a manufacturing
Share
I wasn’t able to do it in a named scope, however, I was able to define a method for the model that solved the problem: