Fix rubocop
This commit is contained in:
parent
c546939a40
commit
dc7778cb8b
6 changed files with 9 additions and 9 deletions
|
@ -26,7 +26,7 @@ module RegistrationLimitationHelper
|
|||
end
|
||||
|
||||
def today_increase_user_count_value
|
||||
User.confirmed.enabled.where('users.created_at >= ?', Time.now.utc.beginning_of_day).joins(:account).merge(Account.without_suspended).count
|
||||
User.confirmed.enabled.where(users: { created_at: Time.now.utc.beginning_of_day.. }).joins(:account).merge(Account.without_suspended).count
|
||||
end
|
||||
|
||||
def registrations_in_time?
|
||||
|
|
|
@ -28,8 +28,8 @@ class Importer::PublicStatusesIndexImporter < Importer::BaseImporter
|
|||
|
||||
def scope
|
||||
to_index = Status.indexable.reorder(nil)
|
||||
to_index = to_index.where('statuses.created_at >= ?', @from) if @from.present?
|
||||
to_index = to_index.where('statuses.created_at < ?', @to) if @to.present?
|
||||
to_index = to_index.where(statuses: { created_at: @from.. }) if @from.present?
|
||||
to_index = to_index.where(statuses: { created_at: ...@to }) if @to.present?
|
||||
to_index
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,8 +17,8 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
|||
|
||||
bulk = ActiveRecord::Base.connection_pool.with_connection do
|
||||
to_index = index.adapter.default_scope.where(id: status_ids)
|
||||
to_index = to_index.where('created_at >= ?', @from) if @from.present?
|
||||
to_index = to_index.where('created_at < ?', @to) if @to.present?
|
||||
to_index = to_index.where(created_at: @from..) if @from.present?
|
||||
to_index = to_index.where(created_at: ...@to) if @to.present?
|
||||
crutches = Chewy::Index::Crutch::Crutches.new index, to_index
|
||||
to_index.map do |object|
|
||||
# This is unlikely to happen, but the post may have been
|
||||
|
|
|
@ -12,6 +12,6 @@ class Vacuum::ListStatusesVacuum
|
|||
private
|
||||
|
||||
def vacuum_list_statuses!
|
||||
ListStatus.where('created_at < ?', LIST_STATUS_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
ListStatus.where(created_at: ...LIST_STATUS_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class Vacuum::NgHistoriesVacuum
|
|||
private
|
||||
|
||||
def vacuum_histories!
|
||||
NgwordHistory.where('created_at < ?', HISTORY_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
NgRuleHistory.where('created_at < ?', HISTORY_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
NgwordHistory.where(created_at: ...HISTORY_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
NgRuleHistory.where(created_at: ...HISTORY_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -212,7 +212,7 @@ module Account::Interactions
|
|||
return false unless local?
|
||||
|
||||
scope = followers
|
||||
scope = scope.where('follows.created_at < ?', since) if since.present?
|
||||
scope = scope.where(follows: { created_at: ...since }) if since.present?
|
||||
scope.exists?(domain: other_domain)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue