1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-28 14:58:21 +09:00

Fix has_one association on Web::PushSubscription (#7767)

* Fix has_one association on Web::PushSubscription

* Fix code style issues
This commit is contained in:
Eugen Rochko 2018-06-09 21:11:14 +02:00 committed by GitHub
parent a043f8d277
commit 17dc07f667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ class Web::PushSubscription < ApplicationRecord
belongs_to :user, optional: true belongs_to :user, optional: true
belongs_to :access_token, class_name: 'Doorkeeper::AccessToken', 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) def push(notification)
I18n.with_locale(associated_user&.locale || I18n.default_locale) do I18n.with_locale(associated_user&.locale || I18n.default_locale) do