[PageOneX] [dev] Should we simplify the data model?

Edward Platt elplatt at media.mit.edu
Wed Feb 13 17:32:29 EST 2013


Hi All,

I've mapped out the data model of PageOneX.  In the attached png, an arrow
represents a "has_one / belongs_to" relationship and a double arrow
represents a "has_many / belongs_to" relationship.

It looks like threadx_image and image_codes are redundant, as well as the
direct association between threadx and highlighted_area.

There seems to be a danger of things getting out of sync.  For instance, if
I understand things correctly, the following two commands should return the
same thing:

HighlightedArea.joins(:code => :threadx).where('threadxes.id = ?', thread.id
).length
# => 6
thread.highlighted_areas.length
# => 237

Pablo, do you know if there was a reason for creating these redundant
associations and models?  Should we remove them?

-Ed
-- 
Edward L. Platt
Civic Technology Programmer
MIT Center for Civic Media
E15-348
http://civic.mit.edu
http://elplatt.com
@EdwardLPlatt <http://twitter.com/edwardlplatt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/pageonexdev/attachments/20130213/3ced569c/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: object_model.png
Type: image/png
Size: 50078 bytes
Desc: not available
Url : http://mailman.mit.edu/mailman/private/pageonexdev/attachments/20130213/3ced569c/attachment-0001.png


More information about the Pageonexdev mailing list