Made some progress
This commit is contained in:
parent
9c4856bdb1
commit
709c6685a9
61 changed files with 570 additions and 37 deletions
33
app/models/stream_entry.rb
Normal file
33
app/models/stream_entry.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
class StreamEntry < ActiveRecord::Base
|
||||
belongs_to :account, inverse_of: :stream_entries
|
||||
belongs_to :activity, polymorphic: true
|
||||
|
||||
def object_type
|
||||
case self.activity_type
|
||||
when 'Status'
|
||||
:note
|
||||
when 'Follow'
|
||||
:person
|
||||
end
|
||||
end
|
||||
|
||||
def verb
|
||||
case self.activity_type
|
||||
when 'Status'
|
||||
:post
|
||||
when 'Follow'
|
||||
:follow
|
||||
end
|
||||
end
|
||||
|
||||
def target
|
||||
case self.activity_type
|
||||
when 'Follow'
|
||||
self.activity.target_account
|
||||
end
|
||||
end
|
||||
|
||||
def content
|
||||
self.activity.text if self.activity_type == 'Status'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue