about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index d98297643..c0b0ca9d9 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -1,6 +1,24 @@
 class Status < ActiveRecord::Base
   belongs_to :account, inverse_of: :statuses
 
+  validates :account, presence: true
+
+  def verb
+    :post
+  end
+
+  def object_type
+    :note
+  end
+
+  def content
+    self.text
+  end
+
+  def title
+    content.truncate(80, omission: "...")
+  end
+
   after_create do
     self.account.stream_entries.create!(activity: self)
   end