about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-11-17 17:58:13 -0600
committerGitHub <noreply@github.com>2017-11-17 17:58:13 -0600
commit284e2cde81811d6289dde9542f9c987062f9e7c2 (patch)
tree739fe0417fce9b9f48f924815b436a50b324dfe9 /app/models/account.rb
parent6f8ccbfcdf7fd8ca651d1583a608e96b25a09e25 (diff)
parent130aa90d5500f481c181a16012724b5f81d62616 (diff)
Merge pull request #224 from yipdw/merge-upstream
Merge upstream (tootsuite/mastodon#5703)
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 230a5d298..a4b8e1c0b 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -3,7 +3,7 @@
 #
 # Table name: accounts
 #
-#  id                      :bigint           not null, primary key
+#  id                      :integer          not null, primary key
 #  username                :string           default(""), not null
 #  domain                  :string
 #  secret                  :string           default(""), not null
@@ -53,6 +53,7 @@ class Account < ApplicationRecord
   include AccountInteractions
   include Attachmentable
   include Remotable
+  include Paginable
 
   MAX_NOTE_LENGTH = 500
 
@@ -97,6 +98,10 @@ class Account < ApplicationRecord
   has_many :account_moderation_notes, dependent: :destroy
   has_many :targeted_moderation_notes, class_name: 'AccountModerationNote', foreign_key: :target_account_id, dependent: :destroy
 
+  # Lists
+  has_many :list_accounts, inverse_of: :account, dependent: :destroy
+  has_many :lists, through: :list_accounts
+
   scope :remote, -> { where.not(domain: nil) }
   scope :local, -> { where(domain: nil) }
   scope :without_followers, -> { where(followers_count: 0) }