0
0
Fork 0

Merge branch 'master' into fix/cache_blocking

This commit is contained in:
Effy Elden 2017-04-17 01:41:33 +10:00 committed by GitHub
commit acd33101c5
48 changed files with 453 additions and 184 deletions

View file

@ -3,6 +3,8 @@
class DomainBlock < ApplicationRecord
enum severity: [:silence, :suspend]
attr_accessor :retroactive
validates :domain, presence: true, uniqueness: true
def self.blocked?(domain)

View file

@ -1,13 +1,15 @@
# frozen_string_literal: true
class Import < ApplicationRecord
FILE_TYPES = ['text/plain', 'text/csv'].freeze
self.inheritance_column = false
belongs_to :account, required: true
enum type: [:following, :blocking, :muting]
belongs_to :account
FILE_TYPES = ['text/plain', 'text/csv'].freeze
validates :type, presence: true
has_attached_file :data, url: '/system/:hash.:extension', hash_secret: ENV['PAPERCLIP_SECRET']
validates_attachment_content_type :data, content_type: FILE_TYPES

View file

@ -110,6 +110,10 @@ class Status < ApplicationRecord
results
end
def non_sensitive_with_media?
!sensitive? && media_attachments.any?
end
class << self
def as_home_timeline(account)
where(account: [account] + account.following)