about summary refs log tree commit diff
path: root/app/models/notification.rb
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-06-01 14:53:37 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-06-01 20:53:37 +0200
commit2212dc4aaa6de729d2fe3e39b134b566935b11b7 (patch)
treeec204dc8ee97926545f36cfd5cd58115d1b5198a /app/models/notification.rb
parente1fdac3e9a173c05c7fd9f5e8bcc255ef4a1e804 (diff)
Update Rails to version 5.1.1 (#3121)
* Update rails to version 5.1.1

* Run `rails app:update`

* Remove the override of polymorphic activity relationship

* Silence warning about otp_secret attribute being unknown to rails

* We will only introduce form_with where we want to use remote data
Diffstat (limited to 'app/models/notification.rb')
-rw-r--r--app/models/notification.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 62c68dfb1..1e64d1ae9 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -48,10 +48,6 @@ class Notification < ApplicationRecord
 
   cache_associated :from_account, status: STATUS_INCLUDES, mention: [status: STATUS_INCLUDES], favourite: [:account, status: STATUS_INCLUDES], follow: :account
 
-  def activity(eager_loaded = true)
-    eager_loaded ? send(activity_type.underscore) : super()
-  end
-
   def type
     @type ||= TYPE_CLASS_MAP.invert[activity_type].to_sym
   end
@@ -96,9 +92,9 @@ class Notification < ApplicationRecord
 
     case activity_type
     when 'Status', 'Follow', 'Favourite', 'FollowRequest'
-      self.from_account_id = activity(false)&.account_id
+      self.from_account_id = activity&.account_id
     when 'Mention'
-      self.from_account_id = activity(false)&.status&.account_id
+      self.from_account_id = activity&.status&.account_id
     end
   end
 end