about summary refs log tree commit diff stats
path: root/db/migrate/20180114170238_cache_current_pokemon_revision.rb
Commit message (Collapse)AuthorAgeFilesLines
* Cached a Pokémon's latest revisionKelly Rauchenberger2018-01-141-0/+19
This removes the need to use a GROUP or DISTINCT in eager-loading Pokémon on the front page. It duplicates data, but provisions are in place to keep the cache up-to-date. When a Pokémon record is updated, it is required that its cache points to the current revision. When a revision is created, it updates the Pokémon's cache to point to it, because a new revision will always be the most recent one, and it is impossible to reorder revisions. This does not affect the number of queries used on the front page (see #1). refs #4