about summary refs log tree commit diff
path: root/app/models/favourite.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-22 11:34:05 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-22 11:34:05 +0100
commit3caf0cfb03841bbd646591ca9bc536ee7d9be918 (patch)
tree899882842d18f2c5dc056354d0fd45f700890499 /app/models/favourite.rb
parent025f7bb223daf88c89649251c28751b36197bff3 (diff)
Ensure that reblogs and favs always refer to the original status rather than a reblog wrapper
Diffstat (limited to 'app/models/favourite.rb')
-rw-r--r--app/models/favourite.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/favourite.rb b/app/models/favourite.rb
index 541ca0831..2fc3d18cd 100644
--- a/app/models/favourite.rb
+++ b/app/models/favourite.rb
@@ -28,4 +28,8 @@ class Favourite < ApplicationRecord
   def target
     thread
   end
+
+  before_validation do
+    self.status = status.reblog if status.reblog?
+  end
 end