diff options
author | Ondřej Hruška <ondra@ondrovo.com> | 2017-07-25 21:36:22 +0200 |
---|---|---|
committer | Ondřej Hruška <ondra@ondrovo.com> | 2017-07-25 21:36:22 +0200 |
commit | 7e5691804d4f0019a89b8b8a3dad532bc9d940ea (patch) | |
tree | 84c2f4e4ac07bea3915639a50df84eb62b6c5768 /app/models | |
parent | 852acbd7385a640d9e00e462d58a847851744034 (diff) | |
parent | 7232cdf7e8249f79078005931b1165e54e413fa9 (diff) |
Merge git://github.com/tootsuite/mastodon into tootsuite-master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/domain_block.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb index f26e8183f..aea8919af 100644 --- a/app/models/domain_block.rb +++ b/app/models/domain_block.rb @@ -12,7 +12,7 @@ # class DomainBlock < ApplicationRecord - enum severity: [:silence, :suspend] + enum severity: [:silence, :suspend, :noop] attr_accessor :retroactive diff --git a/app/models/user.rb b/app/models/user.rb index 25dc25864..96a2d09b7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -53,6 +53,7 @@ class User < ApplicationRecord scope :admins, -> { where(admin: true) } scope :confirmed, -> { where.not(confirmed_at: nil) } scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } + scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended: false }) } scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) } scope :with_recent_ip_address, ->(value) { where(arel_table[:current_sign_in_ip].eq(value).or(arel_table[:last_sign_in_ip].eq(value))) } |