You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a has_many relation, the belongs_to side can specify :counter_cache => true to automatically increment and decrement a count column in the parent model.
Shift signups are currently represented with has_and_belongs_to_many between slot and involvement, with a pure join table. Rendering a signup page with a count of people signed up for each slot thus requires count(*) queries for potentially a couple hundred slots, slowing down shift signup.
Consider creating a join model for this, perhaps named signup, which belongs_to slot, :counter_cache -> true. This could grow a useful field or two, perhaps to mark no-show reason or something.
The text was updated successfully, but these errors were encountered:
With a has_many relation, the belongs_to side can specify :counter_cache => true to automatically increment and decrement a count column in the parent model.
Shift signups are currently represented with has_and_belongs_to_many between slot and involvement, with a pure join table. Rendering a signup page with a count of people signed up for each slot thus requires count(*) queries for potentially a couple hundred slots, slowing down shift signup.
Consider creating a join model for this, perhaps named signup, which belongs_to slot, :counter_cache -> true. This could grow a useful field or two, perhaps to mark no-show reason or something.
The text was updated successfully, but these errors were encountered: