alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Refactor time bound associations #55

Closed saulius closed 11 years ago

saulius commented 11 years ago

Trying to minimze tech debt, so this changes association declarations on various models with aim to simplify them. Check the changes or summary here https://gist.github.com/1b4ac759cfd68563f0e9. It appears that we don't need custom eager loaders and just have to properly utilize time machine scope on association dataset. As a consequence this change improves render time for goods page as now eager loading works better (sequel must know better how to eager load).

In addition to that I trimmed some unnecessary methods from TimeMachine and added some documentation.

Also added description methods on TariffValidationMatchers in rspec so that they won't throw warning when run with documentation formatter.