Merge branch 'release/12.3' into dev

pull/11596/head
ulferts 2 years ago
commit ce8e4501eb
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 16
      app/models/setting.rb
  2. 16
      docs/enterprise-guide/enterprise-cloud-guide/backups/README.md
  3. BIN
      docs/enterprise-guide/enterprise-cloud-guide/backups/backup-enterprise-cloud.png
  4. 41
      spec/models/setting_spec.rb

@ -150,8 +150,22 @@ class Setting < ApplicationRecord
validates :value,
numericality: {
only_integer: true,
if: Proc.new { |setting| setting.format == :integer }
if: ->(setting) { setting.non_null_integer_format? }
}
validates :value,
numericality: {
only_integer: true,
allow_nil: true,
if: ->(setting) { setting.nullable_integer_format? }
}
def nullable_integer_format?
format == :integer && definition.default.nil?
end
def non_null_integer_format?
format == :integer && !definition.default.nil?
end
def value
self.class.deserialize(name, read_attribute(:value))

@ -8,12 +8,22 @@ keywords: backups
# Backups
## Enterprise cloud
## Data retention policy
Your Enterprise cloud data is backed up continuously and retained for 30 days. Within those 30 days we can restore your data to any point in time with a precision of 5 minutes, in case you need us to.
Your Enterprise cloud data is backed up continuously and retained for 30 days. Within those 30 days we can restore your data to any point in time with a precision of 5 minutes, in case you need us to. (currently this is valid only for cloud instances located in the openproject.com cloud environment)
*Note: At the moment it is only possible to restore the complete instance into a former state. All future edits after the former state will be not available in the restored instance. In order to offer you the possibility of recreating the restored information to your productive instance, the restored version is temporarily available on a separate URL. You will have all the time you need to clone the lost information from the temporary instance to the production one. This could be done by using e.g. API calls or manual interaction.*
## Resource limitations for attachments
Currently resource limitations in the Enterprise Cloud allow a Backup to contain attachments only in the case if the file size of all attachments of your instance are less than 1 GB of data. Please contact us at [support@openproject.com](mailto:support@openproject.com) in order to manually request a complete backup containing the SQL dump including all attachments or try to delete unused attachments in order to get below 1 GB of data usage.
In this case you cannot check the **Include attachments** check-box like on the screen-shot below, it will be grayed out:
![backup-enterprise-cloud](backup-enterprise-cloud.png)
## Backup via GUI
**Please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/)**
For detailed usage of the Backup via GUI, please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -179,6 +179,47 @@ describe Setting, type: :model do
expect { described_class.smtp_openssl_verify_mode = 'none' }
.to raise_error NoMethodError
end
context 'for a integer setting with non-nil default value', :settings_reset do
before do
Settings::Definition.add(
'my_setting',
format: :integer,
default: 42
)
end
it 'does not save it when set to nil' do
expect(described_class.my_setting).to eq(42)
described_class.my_setting = nil
expect(described_class.my_setting).not_to be_nil
expect(described_class.my_setting).to eq(42)
end
end
context 'for a integer setting with nil default value', :settings_reset do
before do
Settings::Definition.add(
'my_setting',
format: :integer,
default: nil
)
end
it 'saves it when set to nil' do
described_class.my_setting = 42
expect(described_class.my_setting).to eq(42)
described_class.my_setting = nil
expect(described_class.my_setting).to be_nil
end
it 'saves it as nil when set to empty string' do
described_class.my_setting = 42
expect(described_class.my_setting).to eq(42)
described_class.my_setting = ''
expect(described_class.my_setting).to be_nil
end
end
end
describe '.[setting]_writable?' do

Loading…
Cancel
Save