<p></p>
<p><b>@gravitystorm</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3419#discussion_r783801570">app/models/user.rb</a>:</p>
<pre style='color:#555'>> + # Used in test suite, not something that we would normally need to do.
+ event :deactivate do
+ transitions :from => :active, :to => :pending
+ end
</pre>
<p dir="auto">It's only used in the factory, not in test cases. In the tests we want to default to having users in the "active" state for the vast, vast majority of test cases, but then there's no way to get a user back into the "pending" state for those tests that need it, because direct attribute assignment is disabled.</p>
<p dir="auto">I think rather than a guard I might change it to being wrapped in the check, so that if you e.g. make a diagram using aasm-diagram it doesn't show up.</p>
<p dir="auto">I'm open to better ideas - I thought that there might be a way in FactoryBot to set the attribute without aasm complaining but I couldn't find out how. See also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="288331355" data-permission-text="Title is private" data-url="https://github.com/aasm/aasm/issues/523" data-hovercard-type="issue" data-hovercard-url="/aasm/aasm/issues/523/hovercard" href="https://github.com/aasm/aasm/issues/523">aasm/aasm#523</a></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/3419#discussion_r783801570">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPDRHDJDBJAVOJDPPLUV2OZDANCNFSM5LZUSQPA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPG7DEUCN3RH4MSBXLUV2OZDA5CNFSM5LZUSQPKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOGLALDII.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/3419/review/851489185</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/3419#discussion_r783801570",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3419#discussion_r783801570",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>