1. 06 7月, 2018 1 次提交
    • B
      Preload ancestors after pagination when filtering · de35c044
      Bob Van Landuyt 提交于
      We need to preload the ancestors of search results after applying
      pagination limits. This way the search results itself are paginated,
      but not the ancestors.
      
      If we don't do this, we might not preload a parent group of a search
      result as it has been cut off by pagination.
      de35c044
  2. 03 7月, 2018 1 次提交
  3. 26 6月, 2018 1 次提交
  4. 21 6月, 2018 1 次提交
  5. 19 6月, 2018 1 次提交
  6. 14 6月, 2018 1 次提交
  7. 07 6月, 2018 1 次提交
    • J
      Enable mapping to nil in enums · 0665a8f7
      Jan Provaznik 提交于
      Enum in Rails 5 does not map nil values - IOW nil value remains nil,
      even if there is a key with nil value in the enum definition.
      
      This commit overrides the underlying Enum methods so nil value is
      still mapped. This solution is far from being ideal: it uses dynamic
      definition of methods which introduces more magic/confusion
      into the codebase.
      
      It would be better to get rid of the nil value in enums.
      0665a8f7
  8. 06 6月, 2018 1 次提交
  9. 05 6月, 2018 1 次提交
    • S
      Fix an N+1 in avatar URLs · 6ecf819f
      Sean McGivern 提交于
      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
  10. 04 6月, 2018 1 次提交
  11. 01 6月, 2018 4 次提交
  12. 31 5月, 2018 2 次提交
  13. 30 5月, 2018 2 次提交
  14. 25 5月, 2018 2 次提交
  15. 23 5月, 2018 2 次提交
  16. 18 5月, 2018 4 次提交
  17. 17 5月, 2018 6 次提交
  18. 16 5月, 2018 4 次提交
    • J
      Fixed typo · 8c0166f2
      Jan Provaznik 提交于
      8c0166f2
    • J
      Use find_in_batches instead of destroy_all · c81a37c1
      Jan Provaznik 提交于
      destroy_all loads all records at once
      c81a37c1
    • J
      Delete remote uploads · 7da3b2cd
      Jan Provaznik 提交于
      ObjectStore uploader requires presence of associated `uploads` record
      when deleting the upload file (through the carrierwave's after_commit
      hook) because we keep info whether file is LOCAL or REMOTE in `upload`
      object.
      
      For this reason we can not destroy uploads as "dependent: :destroy" hook
      because these would be deleted too soon. Instead we rely on
      carrierwave's hook to destroy `uploads` in after_commit hook.
      
      But in before_destroy hook we still have to delete not-mounted uploads
      (which don't use carrierwave's destroy hook). This has to be done in
      before_Destroy instead of after_commit because `FileUpload` requires
      existence of model's object on destroy action.
      
      This is not ideal state of things, in a next step we should investigate
      how to unify model dependencies so we can use same workflow for all
      uploads.
      
      Related to #45425
      7da3b2cd
    • M
      Dynamically cast value from cache · 6cc3a07d
      Matija Čupić 提交于
      6cc3a07d
  19. 12 5月, 2018 1 次提交
  20. 11 5月, 2018 3 次提交