[openstreetmap/openstreetmap-website] Enable active_record.belongs_to_required_by_default (PR #3470)
Andy Allan
notifications at github.com
Wed Feb 23 16:08:20 UTC 2022
@gravitystorm commented on this pull request.
> @@ -36,8 +36,8 @@
#
class AccessToken < OauthToken
- belongs_to :user
- belongs_to :client_application
+ belongs_to :user, :optional => true
+ belongs_to :client_application, :optional => true
My line of thinking was `oauth_tokens.user_id` and `.client_application_id` columns are both nullable in the database. So I've marked them `optional` here solely to align with the database structure.
But as you say, feels like it might be worth investigating the db to check if we can make a migration to enforce them.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3470#discussion_r813058601
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3470/review/891315502 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220223/cb7fc3d9/attachment.htm>
More information about the rails-dev
mailing list