Rails 7.1 update (#25963)
This commit is contained in:
parent
379115e601
commit
e93a75f1a1
13 changed files with 122 additions and 89 deletions
|
@ -2,7 +2,7 @@ import './public-path';
|
|||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { delegate } from '@rails/ujs';
|
||||
import delegate from '@rails/ujs';
|
||||
|
||||
import ready from '../mastodon/ready';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import './public-path';
|
|||
import { IntlMessageFormat } from 'intl-messageformat';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import { delegate } from '@rails/ujs';
|
||||
import delegate from '@rails/ujs';
|
||||
import axios from 'axios';
|
||||
import { throttle } from 'lodash';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class CacheBuster
|
||||
def initialize(options = {})
|
||||
ActiveSupport::Deprecation.warn('Default values for the cache buster secret header name and values will be removed in Mastodon 4.3. Please set them explicitely if you rely on those.') unless options[:http_method] || (options[:secret] && options[:secret_header])
|
||||
Rails.application.deprecators[:mastodon].warn('Default values for the cache buster secret header name and values will be removed in Mastodon 4.3. Please set them explicitely if you rely on those.') unless options[:http_method] || (options[:secret] && options[:secret_header])
|
||||
|
||||
@secret_header = options[:secret_header] ||
|
||||
(options[:http_method] ? nil : 'Secret-Header')
|
||||
|
|
|
@ -4,7 +4,7 @@ module HasUserSettings
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
serialize :settings, UserSettingsSerializer
|
||||
serialize :settings, coder: UserSettingsSerializer
|
||||
end
|
||||
|
||||
def settings_attributes=(attributes)
|
||||
|
|
|
@ -15,7 +15,7 @@ module StatusSafeReblogInsert
|
|||
#
|
||||
# The code is kept similar to ActiveRecord::Persistence code and calls it
|
||||
# directly when we are not handling a reblog.
|
||||
def _insert_record(values)
|
||||
def _insert_record(values, returning)
|
||||
return super unless values.is_a?(Hash) && values['reblog_of_id']&.value.present?
|
||||
|
||||
primary_key = self.primary_key
|
||||
|
@ -34,7 +34,7 @@ module StatusSafeReblogInsert
|
|||
# Instead, we use a custom builder when a reblog is happening:
|
||||
im = _compile_reblog_insert(values)
|
||||
|
||||
connection.insert(im, "#{self} Create", primary_key || false, primary_key_value).tap do |result|
|
||||
connection.insert(im, "#{self} Create", primary_key || false, primary_key_value, returning: returning).tap do |result|
|
||||
# Since we are using SELECT instead of VALUES, a non-error `nil` return is possible.
|
||||
# For our purposes, it's equivalent to a foreign key constraint violation
|
||||
raise ActiveRecord::InvalidForeignKey, "(reblog_of_id)=(#{values['reblog_of_id'].value}) is not present in table \"statuses\"" if result.nil?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue