Fix follow IDs #455

Слито
elegaanz слито 4 коммит(ов) из fix-follow-id в master 2019-03-04 20:35:04 +00:00
elegaanz оставлен комментарий 2019-02-27 17:55:14 +00:00 (Перенесено из 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 (Перенесено из github.com) оставлена рецензия 2019-02-27 17:57:09 +00:00
@ -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 (Перенесено из github.com) оставлен комментарий 2019-02-27 17:57:09 +00:00

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] оставлен комментарий 2019-03-04 19:40:15 +00:00 (Перенесено из 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 изменения одобрены 2019-03-04 19:54:46 +00:00
trinity-1686a оставил комментарий
Владелец

LGTM

LGTM
trinity-1686a оставлен комментарий 2019-03-04 19:45:24 +00:00
Владелец

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

I've never used this syntax, but it looks super nice
trinity-1686a оставлен комментарий 2019-03-04 19:52:42 +00:00
Владелец

this route should really get implemented one day

this route should really get implemented one day
elegaanz (Перенесено из github.com) оставлена рецензия 2019-03-04 20:23:48 +00:00
elegaanz (Перенесено из github.com) оставлен комментарий 2019-03-04 20:23:48 +00:00

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

Yes, I think we already have an issue for it…
igalic (Перенесено из github.com) оставлена рецензия 2019-03-05 07:12:24 +00:00
igalic (Перенесено из github.com) оставлен комментарий 2019-03-05 07:12:23 +00:00

what does it do?

what does it do?
elegaanz (Перенесено из github.com) оставлена рецензия 2019-03-05 08:19:59 +00:00
elegaanz (Перенесено из github.com) оставлен комментарий 2019-03-05 08:19:59 +00:00

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()`).
Войдите, чтобы присоединиться к обсуждению.
Нет рецензентов
Нет этапа
Нет проекта
Нет назначенных
2 участников
Уведомления
Срок выполнения
Срок выполнения недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат «гггг-мм-дд».

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: Plume/Plume#455
Описание отсутствует.