diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-02-22 18:10:30 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-02-22 18:10:30 +0100 |
commit | 1dad72bf13f5e28781a2b2b6654f72624d205576 (patch) | |
tree | 27cc73b474b1cce88751a822374431837f24309a /app/models/status.rb | |
parent | 709c6685a90bb819696566cc9e42e587546d72dc (diff) |
Fixes and general progress
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 18 |
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 |