anhonigman1848/mhsbake — comment on commit 216a59d3efc6d87d76b4ca1986cdbf43850103f8
File:  line 0
By sedan444:

First of all, I cleaned up some Accessor stuff.

Then I created a controller called NewspaperRecordController. You can see what it does by going to mhsbake/newspaperrecords. Essentially, it is an alias for NewspaperReelController. That is, it uses the NewspaperReels model. However, it has it's own index and view ctp files (add and edit are yet to come). This allows us to expand these index and view files to show additional data.

The trick was to modify the NewspaperReels model so that it returns all data for a given record. I had to tweak the $belongsTo array and add Newspaper to it (Andy, please take a look at what I did). The benefit of this is that everything necessary to populate the Newspaper Records page (or to populate a single record view) is done with one query (I don't count the 'count' query).

The add and edit functions will be a little tricky, as we need to make sure each table is updated correctly. Also, everything we do here will need to be paralleled in Archives. If someone else does Archives, please look at the changes made specifically in this commit.