1. 27 Jul, 2018 1 commit
  2. 05 Jun, 2018 1 commit
    • Sean McGivern's avatar
      Fix an N+1 in avatar URLs · 6ecf819f
      Sean McGivern authored
      This is tricky: the query was being run in
      `ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't
      just add batch loading there, because the `#upload=` method there would use the
      result immediately, making the batch only have one item.
      
      Instead, we can pre-emptively add an item to the batch whenever an avatarable
      object is initialized, and then reuse that batch item in
      `#retrieve_from_store!`. However, this also has problems:
      
      1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`.
      2. Some of that logic constructs a 'fake' model for the batch key. This should
         be fine, because of ActiveRecord's override of `#==`, but it relies on that
         staying the same.
      6ecf819f
  3. 03 Jun, 2016 2 commits
  4. 09 May, 2016 1 commit
  5. 06 May, 2016 1 commit
  6. 06 Mar, 2016 1 commit
  7. 09 Oct, 2014 1 commit
  8. 09 Apr, 2014 1 commit
  9. 21 Aug, 2013 1 commit
  10. 19 Jun, 2013 1 commit
  11. 24 Mar, 2013 2 commits
  12. 05 Feb, 2013 1 commit
  13. 05 Jan, 2013 1 commit
  14. 04 Jan, 2013 1 commit
  15. 19 Nov, 2012 1 commit
  16. 09 Oct, 2012 2 commits
  17. 26 Sep, 2012 1 commit
  18. 02 Sep, 2012 1 commit
  19. 29 Aug, 2012 2 commits
  20. 11 Aug, 2012 1 commit
  21. 02 Aug, 2012 1 commit
  22. 26 Jun, 2012 1 commit
  23. 26 May, 2012 1 commit
  24. 11 May, 2012 1 commit
  25. 15 Feb, 2012 1 commit