AO3-7135 Record canonized/decanonized dates on tags - #5954
Open
pmonfort wants to merge 1 commit into
Open
Conversation
pmonfort
force-pushed
the
AO3-7135
branch
2 times, most recently
from
July 29, 2026 05:10
ed85026 to
b2c6cf2
Compare
sarken
requested changes
Aug 15, 2026
sarken
left a comment
Collaborator
There was a problem hiding this comment.
Looking pretty good! Could you add a test in features/tags_and_wrangling/tag_search.feature to check the results of sorting?
| And I should not see "Last decanonized on" | ||
| When I check "Canonical" | ||
| And I press "Save changes" | ||
| And I edit the tag "Amelie" |
Collaborator
There was a problem hiding this comment.
Once you save changes, you should be redirected to the tag edit page, so this step would ideally be unnecessary... Did you try it without? (I can understand if you did and it failed due to the test running too quickly, but I wanted to ask just the same.)
| <% if @tag.canonized_at || @tag.decanonized_at %> | ||
| <p class="notes"> | ||
| <% if @tag.canonized_at %> | ||
| <%= t(".last_canonized", date: @tag.canonized_at.utc.strftime("%Y-%m-%d %H:%M:%S")) %> |
Collaborator
There was a problem hiding this comment.
Do we need strftime here? I get the desired format just by using utc (although, to be fair, I tried it on @tag.updated_at since that was what I had handy)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
AO3-1234 Fix thing)Issue
https://otwarchive.atlassian.net/browse/AO3-7135
Purpose
Adds two new datetime columns (
canonized_atanddecanonized_at) to thetagstable to record when a tag was most recently canonized or decanonized.before_savecallback setscanonized_atwhen a tag becomes canonical, anddecanonized_atwhen it becomes non-canonical.Testing Instructions
superadmin,policy_and_abuse, ortag_wranglingrole.Credit
Pablo Monfort (he/him)