<p></p>
<p><b>@nenad-vujicic</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5494#discussion_r1915580473">app/models/note_comment.rb</a>:</p>
<pre style='color:#555'>> @@ -36,6 +36,26 @@ class NoteComment < ApplicationRecord
validates :event, :inclusion => %w[opened closed reopened commented hidden]
validates :body, :length => { :maximum => 2000 }, :characters => true
+ # Return the note's description for first special comment (event is "opened")
+ # otherwise return the comment text
+ def tmp_body
</pre>
<p dir="auto">I was trying to improve 'direct' access to comment's body / author (where first comment is accessed), so when we do data-migration it selects note's description / author (for first special comment) if migration is performed, otherwise, if migration is not done, selects comment's body / author.</p>
<p dir="auto">Another reason is to hide logic (and don't do unwrapping of if-statements) from .(j)builder / _comment.html.erb / .. files where first comments are also accessed (mentioned <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485#discussion_r1912484985" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5485/hovercard">here</a>).</p>
<p dir="auto">Perhaps we can find some better name or remove if really not necessary?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5494#discussion_r1915580473">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLN525YPTNVLH46LBA32KVZ4BAVCNFSM6AAAAABVCJTAUGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNJQHE4DOMZQGQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL6TH55Y6OYDVJVLU32KVZ4BA5CNFSM6AAAAABVCJTAUGWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUYBT5CQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5494/review/2550987304</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5494#discussion_r1915580473",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5494#discussion_r1915580473",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>