Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed May 23, 2024
1 parent c546939 commit dc7778c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/helpers/registration_limitation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def today_increase_user_count
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?
Expand Down
4 changes: 2 additions & 2 deletions app/lib/importer/public_statuses_index_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def index

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
4 changes: 2 additions & 2 deletions app/lib/importer/statuses_index_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def import!

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
Expand Down
2 changes: 1 addition & 1 deletion app/lib/vacuum/list_statuses_vacuum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def perform
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
4 changes: 2 additions & 2 deletions app/lib/vacuum/ng_histories_vacuum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def perform
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
2 changes: 1 addition & 1 deletion app/models/concerns/account/interactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def followed_by_domain?(other_domain, since = nil)
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

Expand Down

0 comments on commit dc7778c

Please sign in to comment.