diff options
author | Reverite <github@reverite.sh> | 2019-03-10 19:19:52 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-03-10 19:19:52 -0700 |
commit | 229e2726cad36066afb210d7087a40cd9f955483 (patch) | |
tree | a14d55e9469f1f339fc40b777827aa4886bb7889 /app/models/concerns | |
parent | 715c552fe4c1b2d59bf1f281d77b6e2546bdb531 (diff) | |
parent | 3cef04610cd809c7bd01adc00d34fb3d25261a16 (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/account_associations.rb | 1 | ||||
-rw-r--r-- | app/models/concerns/status_threading_concern.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/models/concerns/account_associations.rb b/app/models/concerns/account_associations.rb index 3ab8a0daa..1b22f750c 100644 --- a/app/models/concerns/account_associations.rb +++ b/app/models/concerns/account_associations.rb @@ -27,6 +27,7 @@ module AccountAssociations # Media has_many :media_attachments, dependent: :destroy + has_many :polls, dependent: :destroy # PuSH subscriptions has_many :subscriptions, dependent: :destroy diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb index b9c800c2a..15eb695cd 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status_threading_concern.rb @@ -11,6 +11,10 @@ module StatusThreadingConcern find_statuses_from_tree_path(descendant_ids(limit, max_child_id, since_child_id, depth), account, promote: true) end + def self_replies(limit) + account.statuses.where(in_reply_to_id: id, visibility: [:public, :unlisted]).reorder(id: :asc).limit(limit) + end + private def ancestor_ids(limit) |