use atomic incrementing on Frame#create and decrementing on Frame#destroy -- could do this very simply as an after filter
will need to default this to 0 and will need to run through all Rolls in DB updating frame_count
Roll.find_each.each { |r| r.update_attribute(:frame_count, r.frames.count) }
use atomic incrementing on Frame#create and decrementing on Frame#destroy -- could do this very simply as an after filter
will need to default this to 0 and will need to run through all Rolls in DB updating frame_count
Roll.find_each.each { |r| r.update_attribute(:frame_count, r.frames.count) }
be sure to write tests
return this attribute whenever returning rolls