Merge commit '5a437edc7f22d5797e5af29d9b450a03eccec304' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2023-10-08 17:05:40 +02:00
commit a5dbb1ee5a
6 changed files with 21 additions and 10 deletions

View File

@ -282,8 +282,8 @@ jobs:
ports:
- 6379:6379
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.13
search:
image: ${{ matrix.search-image }}
env:
discovery.type: single-node
xpack.security.enabled: false
@ -313,6 +313,11 @@ jobs:
- '3.0'
- '3.1'
- '.ruby-version'
search-image:
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
include:
- ruby-version: '.ruby-version'
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
steps:
- uses: actions/checkout@v4

View File

@ -324,7 +324,7 @@ GEM
ruby-progressbar (~> 1.4)
globalid (1.1.0)
activesupport (>= 5.0)
haml (6.1.2)
haml (6.2.0)
temple (>= 0.8.2)
thor
tilt
@ -333,8 +333,8 @@ GEM
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
haml_lint (0.50.0)
haml (>= 4.0, < 6.2)
haml_lint (0.51.0)
haml (>= 4.0)
parallel (~> 1.10)
rainbow
rubocop (>= 1.0)
@ -747,7 +747,7 @@ GEM
climate_control (>= 0.0.3, < 1.0)
test-prof (1.2.3)
thor (1.2.2)
tilt (2.2.0)
tilt (2.3.0)
timeout (0.4.0)
tpm-key_attestation (0.12.0)
bindata (~> 2.4)
@ -773,7 +773,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
uri (0.12.2)
validate_email (0.1.6)
activemodel (>= 3.0)

View File

@ -100,7 +100,7 @@ class LinkFooter extends PureComponent {
{DividingCircle}
<a href={source_url} rel='noopener noreferrer' target='_blank'><FormattedMessage id='footer.source_code' defaultMessage='View source code' /></a>
{DividingCircle}
v{version}
<span class='version'>v{version}</span>
</p>
</div>
);

View File

@ -9009,6 +9009,10 @@ noscript {
color: $dark-text-color;
margin-bottom: 20px;
.version {
white-space: nowrap;
}
strong {
font-weight: 500;
}

View File

@ -34,7 +34,9 @@ class Importer::BaseImporter
# Estimate the amount of documents that would be indexed. Not exact!
# @returns [Integer]
def estimate!
ActiveRecord::Base.connection_pool.with_connection { |connection| connection.select_one("SELECT reltuples AS estimate FROM pg_class WHERE relname = '#{index.adapter.target.table_name}'")['estimate'].to_i }
reltuples = ActiveRecord::Base.connection_pool.with_connection { |connection| connection.select_one("SELECT reltuples FROM pg_class WHERE relname = '#{index.adapter.target.table_name}'")['reltuples'].to_i }
# If the table has never yet been vacuumed or analyzed, reltuples contains -1
[reltuples, 0].max
end
# Import data from the database into the index

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class BackupPolicy < ApplicationPolicy
MIN_AGE = 1.week
MIN_AGE = 6.days
def create?
user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero?