mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-20 17:23:17 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
6d173cec8e
28 changed files with 406 additions and 347 deletions
|
|
@ -129,7 +129,7 @@ class Account < ApplicationRecord
|
|||
|
||||
delegate :chosen_languages, to: :user, prefix: false, allow_nil: true
|
||||
|
||||
update_index('accounts#account', :self) if Chewy.enabled?
|
||||
update_index('accounts#account', :self)
|
||||
|
||||
def local?
|
||||
domain.nil?
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
class AccountStat < ApplicationRecord
|
||||
belongs_to :account, inverse_of: :account_stat
|
||||
|
||||
update_index('accounts#account', :account) if Chewy.enabled?
|
||||
update_index('accounts#account', :account)
|
||||
|
||||
def increment_count!(key)
|
||||
update(attributes_for_increment(key))
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@ class ApplicationRecord < ActiveRecord::Base
|
|||
|
||||
include Remotable
|
||||
|
||||
class << self
|
||||
def update_index(_type_name, *_args, &_block)
|
||||
super if Chewy.enabled?
|
||||
end
|
||||
end
|
||||
|
||||
def boolean_with_default(key, default_value)
|
||||
value = attributes[key]
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
class Favourite < ApplicationRecord
|
||||
include Paginable
|
||||
|
||||
update_index('statuses#status', :status) if Chewy.enabled?
|
||||
update_index('statuses#status', :status)
|
||||
|
||||
belongs_to :account, inverse_of: :favourites
|
||||
belongs_to :status, inverse_of: :favourites
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Status < ApplicationRecord
|
|||
# will be based on current time instead of `created_at`
|
||||
attr_accessor :override_timestamps
|
||||
|
||||
update_index('statuses#status', :proper) if Chewy.enabled?
|
||||
update_index('statuses#status', :proper)
|
||||
|
||||
enum visibility: [:public, :unlisted, :private, :direct, :limited], _suffix: :visibility
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class Tag < ApplicationRecord
|
|||
|
||||
after_save :save_account_tag_stat
|
||||
|
||||
update_index('tags#tag', :self) if Chewy.enabled?
|
||||
update_index('tags#tag', :self)
|
||||
|
||||
def account_tag_stat
|
||||
super || build_account_tag_stat
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue