Merge remote-tracking branch 'origin/master' into gs-master
Conflicts: .travis.yml Gemfile.lock README.md app/controllers/settings/follower_domains_controller.rb app/controllers/statuses_controller.rb app/javascript/mastodon/locales/ja.json app/lib/feed_manager.rb app/models/media_attachment.rb app/models/mute.rb app/models/status.rb app/services/mute_service.rb app/views/home/index.html.haml app/views/stream_entries/_simple_status.html.haml config/locales/ca.yml config/locales/en.yml config/locales/es.yml config/locales/fr.yml config/locales/nl.yml config/locales/pl.yml config/locales/pt-BR.yml config/themes.yml
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
#
|
||||
# Table name: statuses
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# id :bigint(8) not null, primary key
|
||||
# uri :string
|
||||
# text :text default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# in_reply_to_id :integer
|
||||
# reblog_of_id :integer
|
||||
# in_reply_to_id :bigint(8)
|
||||
# reblog_of_id :bigint(8)
|
||||
# url :string
|
||||
# sensitive :boolean default(FALSE), not null
|
||||
# visibility :integer default("public"), not null
|
||||
@@ -18,11 +18,11 @@
|
||||
# favourites_count :integer default(0), not null
|
||||
# reblogs_count :integer default(0), not null
|
||||
# language :string
|
||||
# conversation_id :integer
|
||||
# conversation_id :bigint(8)
|
||||
# local :boolean
|
||||
# account_id :integer not null
|
||||
# application_id :integer
|
||||
# in_reply_to_account_id :integer
|
||||
# account_id :bigint(8) not null
|
||||
# application_id :bigint(8)
|
||||
# in_reply_to_account_id :bigint(8)
|
||||
# local_only :boolean
|
||||
# full_status_text :text default(""), not null
|
||||
#
|
||||
@@ -62,6 +62,7 @@ class Status < ApplicationRecord
|
||||
validates :uri, uniqueness: true, presence: true, unless: :local?
|
||||
validates :text, presence: true, unless: -> { with_media? || reblog? }
|
||||
validates_with StatusLengthValidator
|
||||
validates_with DisallowedHashtagsValidator
|
||||
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
||||
|
||||
default_scope { recent }
|
||||
@@ -164,7 +165,7 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def emojis
|
||||
CustomEmoji.from_text([spoiler_text, text].join(' '), account.domain)
|
||||
@emojis ||= CustomEmoji.from_text([spoiler_text, text].join(' '), account.domain)
|
||||
end
|
||||
|
||||
after_create_commit :store_uri, if: :local?
|
||||
|
||||
Reference in New Issue
Block a user