Adjusting design of public pages, optimizing account page queries
This commit is contained in:
parent
ab80ebdeec
commit
aab330eb2d
8 changed files with 79 additions and 34 deletions
|
@ -1,14 +1,14 @@
|
|||
class Status < ActiveRecord::Base
|
||||
belongs_to :account, inverse_of: :statuses
|
||||
|
||||
belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status'
|
||||
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status'
|
||||
belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :replies
|
||||
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs
|
||||
|
||||
has_one :stream_entry, as: :activity, dependent: :destroy
|
||||
|
||||
has_many :favourites, inverse_of: :status, dependent: :destroy
|
||||
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status'
|
||||
has_many :replies, foreign_key: 'in_reply_to_id', class_name: 'Status'
|
||||
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblog
|
||||
has_many :replies, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :thread
|
||||
has_many :mentioned_accounts, class_name: 'Mention', dependent: :destroy
|
||||
|
||||
validates :account, presence: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue