Fix follow IDs #455

已合并
elegaanz 5 年前 将 4 次代码提交从 fix-follow-id 合并至 master
elegaanz 评论于 5 年前 (从 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 迁移) 评审于 5 年前
@ -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 迁移) 评论于 5 年前

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] 评论于 5 年前 (从 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-1686a5 年前 批准此合并请求
trinity-1686a 留下了一条评论
所有者

LGTM

LGTM
所有者

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

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

this route should really get implemented one day

this route should really get implemented one day
elegaanz (从 github.com 迁移) 评审于 5 年前
elegaanz (从 github.com 迁移) 评论于 5 年前

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

Yes, I think we already have an issue for it…
igalic (从 github.com 迁移) 评审于 5 年前
igalic (从 github.com 迁移) 评论于 5 年前

what does it do?

what does it do?
elegaanz (从 github.com 迁移) 评审于 5 年前
elegaanz (从 github.com 迁移) 评论于 5 年前

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()`).

评审人

trinity-1686a5 年前 批准此合并请求
该合并请求已作为 2a188abfa1 被合并。
你也可以查看 命令行指令

第一步:

从你的仓库中签出一个新的分支并测试变更。
git checkout -b fix-follow-id master
git pull origin fix-follow-id

第二步:

合并变更并更新到 Forgejo 上
git checkout master
git merge --no-ff fix-follow-id
git push origin master
登录 并参与到对话中。
无审核者
未选择里程碑
未指派成员
2 名参与者
通知
到期时间
到期日期无效或超出范围。请使用 'yyyy-mm-dd' 格式。

未设置到期时间。

依赖工单

没有设置依赖项。

参考:Plume/Plume#455
正在加载...
这个人很懒,什么都没留下。