Fix rubocop

This commit is contained in:
KMY 2024-07-05 07:34:53 +09:00
parent 6b59ce6985
commit efa0c376bc
23 changed files with 32 additions and 32 deletions

View file

@ -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

View file

@ -23,7 +23,7 @@ module Attachmentable
included do
def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicateName
super(name, options)
super
send(:"before_#{name}_validate", prepend: true) do
attachment = send(name)

View file

@ -4,7 +4,7 @@ module Expireable
extend ActiveSupport::Concern
included do
scope :expired, -> { where.not(expires_at: nil).where('expires_at < ?', Time.now.utc) }
scope :expired, -> { where.not(expires_at: nil).where(expires_at: ...Time.now.utc) }
def expires_in
return @expires_in if defined?(@expires_in)

View file

@ -24,7 +24,7 @@ class Invite < ApplicationRecord
belongs_to :user, inverse_of: :invites
has_many :users, inverse_of: :invite, dependent: nil
scope :available, -> { where(expires_at: nil).or(where('expires_at >= ?', Time.now.utc)) }
scope :available, -> { where(expires_at: nil).or(where(expires_at: Time.now.utc..)) }
validates :comment, length: { maximum: COMMENT_SIZE_LIMIT }

View file

@ -394,7 +394,7 @@ class Status < ApplicationRecord
end
def add_status_referred_by_count!(diff)
update_status_stat!(status_referred_by_count: [public_send(:status_referred_by_count) + diff, 0].max)
update_status_stat!(status_referred_by_count: [status_referred_by_count + diff, 0].max)
end
def emoji_reactions_grouped_by_name(account = nil, **options)