about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-22 11:35:00 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-22 11:35:00 +0100
commitf91b6fa9e15029f23be7be3b796eca122e5b5588 (patch)
treed2cbfbc057a4b6ac5c36c9a1673b939b7e0313a9 /app/models
parent80e02b90e4210b0f4982be6a8e817900143374a5 (diff)
parent3caf0cfb03841bbd646591ca9bc536ee7d9be918 (diff)
Merge branch 'master' into development
Diffstat (limited to 'app/models')
-rw-r--r--app/models/favourite.rb4
-rw-r--r--app/models/status.rb1
2 files changed, 5 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
diff --git a/app/models/status.rb b/app/models/status.rb
index 603f3b7a2..1e6298a0e 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -168,6 +168,7 @@ class Status < ApplicationRecord
 
   before_validation do
     text.strip!
+    self.reblog = reblog.reblog if reblog? && reblog.reblog?
     self.in_reply_to_account_id = thread.account_id if reply?
     self.visibility             = :public if visibility.nil?
   end