]> cat aescling's git repositories - mastodon.git/commitdiff
Fix has_one association on Web::PushSubscription (#7767)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 9 Jun 2018 19:11:14 +0000 (21:11 +0200)
committerGitHub <noreply@github.com>
Sat, 9 Jun 2018 19:11:14 +0000 (21:11 +0200)
* Fix has_one association on Web::PushSubscription

* Fix code style issues

app/models/web/push_subscription.rb

index 867bc9519130174457d0c2121f6687c14538ce72..d19b20c483f66f0adbc7e10653b0bf370fc12680 100644 (file)
@@ -18,7 +18,7 @@ class Web::PushSubscription < ApplicationRecord
   belongs_to :user, optional: true
   belongs_to :access_token, class_name: 'Doorkeeper::AccessToken', optional: true
 
-  has_one :session_activation
+  has_one :session_activation, foreign_key: 'web_push_subscription_id', inverse_of: :web_push_subscription
 
   def push(notification)
     I18n.with_locale(associated_user&.locale || I18n.default_locale) do