Fix follow IDs #455

Samengevoegd
elegaanz heeft 4 commits samengevoegd van fix-follow-id naar master 5 jaren geleden
elegaanz reageerde 5 jaren geleden (Gemigreerd van github.com)

I changed the syntax of the insert! macro, allowing to modify an object just after it was saved to the database. You can now optional pass it a "closure" (actually it just looks like a closure) that will be run just after the insertion.

I updated all the models, including Follow, to use it to generate AP ID and URL. The advantages are that the ID/URL are now correct (fixes #449) and that we don't have methods like update_boxes or update_ap_url to call manually and that were easy to forget.

I changed the syntax of the `insert!` macro, allowing to modify an object just after it was saved to the database. You can now optional pass it a "closure" (actually it just looks like a closure) that will be run just after the insertion. I updated all the models, including Follow, to use it to generate AP ID and URL. The advantages are that the ID/URL are now correct (fixes #449) and that we don't have methods like `update_boxes` or `update_ap_url` to call manually and that were easy to forget.
elegaanz (Gemigreerd van github.com) beoordeeld 5 jaren geleden
@ -228,4 +228,3 @@
post.cover_id = form.cover;
post.update(&*conn, &searcher).expect("post::update: update error");;
let post = post.update_ap_url(&*conn).expect("post::update: update ap url error");
elegaanz (Gemigreerd van github.com) reageerde 5 jaren geleden

Just a note: I removed that without replacing it with something else, since it is incorrect (the AP IDs should change), and was not working anyway (since we were checking if ap_url was empty before updating it, which was only the case on newly created articles).

Just a note: I removed that without replacing it with something else, since it is incorrect (the AP IDs should change), and was not working anyway (since we were checking if `ap_url` was empty before updating it, which was only the case on newly created articles).
codecov[bot] reageerde 5 jaren geleden (Gemigreerd van github.com)

Codecov Report

Merging #455 into master will increase coverage by 1.41%.
The diff coverage is 79.31%.

@@            Coverage Diff             @@
##           master     #455      +/-   ##
==========================================
+ Coverage   25.06%   26.48%   +1.41%     
==========================================
  Files          64       64              
  Lines        6316     7111     +795     
==========================================
+ Hits         1583     1883     +300     
- Misses       4733     5228     +495
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/455?src=pr&el=h1) Report > Merging [#455](https://codecov.io/gh/Plume-org/Plume/pull/455?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/a2b9d7ec44daf91d5b0dde00715d7185b5342c94?src=pr&el=desc) will **increase** coverage by `1.41%`. > The diff coverage is `79.31%`. ```diff @@ Coverage Diff @@ ## master #455 +/- ## ========================================== + Coverage 25.06% 26.48% +1.41% ========================================== Files 64 64 Lines 6316 7111 +795 ========================================== + Hits 1583 1883 +300 - Misses 4733 5228 +495 ```
trinity-1686a heeft deze veranderingen 5 jaren geleden goedgekeurd
trinity-1686a heeft een reactie achtergelaten
Eigenaar

LGTM

LGTM
Eigenaar

I've never used this syntax, but it looks super nice

I've never used this syntax, but it looks super nice
Eigenaar

this route should really get implemented one day

this route should really get implemented one day
elegaanz (Gemigreerd van github.com) beoordeeld 5 jaren geleden
elegaanz (Gemigreerd van github.com) reageerde 5 jaren geleden

Yes, I think we already have an issue for it…

Yes, I think we already have an issue for it…
igalic (Gemigreerd van github.com) beoordeeld 5 jaren geleden
igalic (Gemigreerd van github.com) reageerde 5 jaren geleden

what does it do?

what does it do?
elegaanz (Gemigreerd van github.com) beoordeeld 5 jaren geleden
elegaanz (Gemigreerd van github.com) reageerde 5 jaren geleden

For all the fields that were not provided, it takes their value from the given struct (here NewBlog::default()).

For all the fields that were not provided, it takes their value from the given struct (here `NewBlog::default()`).

Reviewers

trinity-1686a heeft deze veranderingen 5 jaren geleden goedgekeurd
De pull request is samengevoegd als 2a188abfa1.
Je kunt ook command line instructies bekijken.

Stap 1:

Vanuit het project, check een branch uit en test de veranderingen.
git checkout -b fix-follow-id master
git pull origin fix-follow-id

Stap 2:

Voeg de wijzigingen samen en update ze op Forgejo.
git checkout master
git merge --no-ff fix-follow-id
git push origin master
Log in om deel te nemen aan deze discussie.
Geen beoordelaars
Geen mijlpaal
Niet toegewezen
2 deelnemers
Notificaties
Vervaldatum
De deadline is ongeldig of buiten bereik. Gebruik het formaat 'jjjj-mm-dd'.

Geen vervaldatum ingesteld.

Afhankelijkheden

Geen afhankelijkheden ingesteld.

Referentie: Plume/Plume#455
Laden…
Er is nog geen inhoud.