rubyforgood / save_the_animals_api

related to https://github.com/rubyforgood/offline_pandas
MIT License
5 stars 2 forks source link

Fix observation session query #34

Closed willmurphyscode closed 7 years ago

willmurphyscode commented 7 years ago

This fix caches the ObservationSession instance where possible to prevent running a select query against observation sessions every time an observation is inserted.

It also adds some more JSON observation objects to the test data so that redundant query work will be easier to see in test logs, if it ever comes up again.

willmurphyscode commented 7 years ago

I ran rubocop - the only thing it complains about in observation_session_controller is that the create method is too long, both by line count and Abc size. Is that something you'd like me to refactor out?

rposborne commented 7 years ago

@willmurphyscode ABC / length does not need to be refactored out.