Change default for ignore_non_working_days on work packages

pull/10829/head
Dombi Attila 2 years ago
parent 40866dd700
commit a519ba0c72
  1. 13
      db/migrate/20220830092057_change_default_for_non_working_days.rb
  2. 4
      spec/contracts/work_packages/base_contract_spec.rb
  3. 2
      spec/models/work_package_spec.rb

@ -0,0 +1,13 @@
class ChangeDefaultForNonWorkingDays < ActiveRecord::Migration[7.0]
def change
change_column_default :work_packages, :ignore_non_working_days, from: true, to: false
reversible do |dir|
dir.up do
execute <<~SQL.squish
UPDATE work_packages SET ignore_non_working_days = TRUE
SQL
end
end
end
end

@ -694,10 +694,10 @@ describe WorkPackages::BaseContract do
it_behaves_like 'contract is valid'
end
context 'when setting the value to false and with the feature disabled',
context 'when setting the value to true and with the feature disabled',
with_flag: { work_packages_duration_field_active: false } do
before do
work_package.ignore_non_working_days = false
work_package.ignore_non_working_days = true
end
it_behaves_like 'contract is invalid', ignore_non_working_days: :error_readonly

@ -699,7 +699,7 @@ describe WorkPackage, type: :model do
context 'for a new record' do
it 'is true' do
expect(described_class.new.ignore_non_working_days)
.to be true
.to be false
end
end
end

Loading…
Cancel
Save