Merge commit '04492e7f934d07f8e89fa9c3d4fe3381f251e8a2' into glitch-soc/merge-upstream
This commit is contained in:
commit
4bea9a0a66
83 files changed
+1520
-846
No files matched your search
+20
-11
@@ -4,17 +4,18 @@
|
||||
#
|
||||
# Table name: announcements
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# text :text default(""), not null
|
||||
# published :boolean default(FALSE), not null
|
||||
# all_day :boolean default(FALSE), not null
|
||||
# scheduled_at :datetime
|
||||
# starts_at :datetime
|
||||
# ends_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# published_at :datetime
|
||||
# status_ids :bigint(8) is an Array
|
||||
# id :bigint(8) not null, primary key
|
||||
# all_day :boolean default(FALSE), not null
|
||||
# ends_at :datetime
|
||||
# notification_sent_at :datetime
|
||||
# published :boolean default(FALSE), not null
|
||||
# published_at :datetime
|
||||
# scheduled_at :datetime
|
||||
# starts_at :datetime
|
||||
# status_ids :bigint(8) is an Array
|
||||
# text :text default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class Announcement < ApplicationRecord
|
||||
@@ -54,6 +55,10 @@ class Announcement < ApplicationRecord
|
||||
update!(published: false, scheduled_at: nil)
|
||||
end
|
||||
|
||||
def notification_sent?
|
||||
notification_sent_at.present?
|
||||
end
|
||||
|
||||
def mentions
|
||||
@mentions ||= Account.from_text(text)
|
||||
end
|
||||
@@ -86,6 +91,10 @@ class Announcement < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def scope_for_notification
|
||||
User.confirmed.joins(:account).merge(Account.without_suspended)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def grouped_ordered_announcement_reactions
|
||||
|
||||
@@ -9,11 +9,12 @@ class TermsOfService::Generator
|
||||
admin_email
|
||||
arbitration_address
|
||||
arbitration_website
|
||||
choice_of_law
|
||||
dmca_address
|
||||
dmca_email
|
||||
domain
|
||||
jurisdiction
|
||||
choice_of_law
|
||||
min_age
|
||||
).freeze
|
||||
|
||||
attr_accessor(*VARIABLES)
|
||||
|
||||
Reference in new issue
Block a user