Merge git://github.com/tootsuite/mastodon into tootsuite-master

This commit is contained in:
Ondřej Hruška
2017-07-25 21:36:22 +02:00
139 changed files with 1196 additions and 758 deletions

View File

@@ -12,7 +12,7 @@
#
class DomainBlock < ApplicationRecord
enum severity: [:silence, :suspend]
enum severity: [:silence, :suspend, :noop]
attr_accessor :retroactive

View File

@@ -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))) }