Basically, I want an array of ids from the database.
Some background:
- I'm rendering a list of objets (foos) to the user with a checkbox.
- If the user checks the box a row is create in a different table (bar)
- when rendering the foo list + checkbox I want to check if the unique id any given foo already exists in the bar id array.
I assumed that getting an array of ids would be much more efficient than querying the database for each instance of foo when rendering the foo list with checkboxes.
Ideas? Apologies in advance if this is not clear.