mirror of
https://github.com/anteo/redmine_custom_workflows.git
synced 2026-01-26 00:04:20 +00:00
Rubocop tests
This commit is contained in:
parent
3e432ecd6d
commit
4b7d972232
@ -56,5 +56,9 @@ Metrics/CyclomaticComplexity:
|
|||||||
Rails/HasAndBelongsToMany:
|
Rails/HasAndBelongsToMany:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Rails/SkipsModelValidations:
|
||||||
|
Exclude:
|
||||||
|
- db/migrate/20210210144000_change_default_active_boolean_value_to_custom_workflows.rb
|
||||||
|
|
||||||
Style/ExpandPathArguments:
|
Style/ExpandPathArguments:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@ -25,15 +25,15 @@ class ChangeDefaultActiveBooleanValueToCustomWorkflows < ActiveRecord::Migration
|
|||||||
return unless ActiveRecord::Base.connection.adapter_name.match?(/sqlite/i)
|
return unless ActiveRecord::Base.connection.adapter_name.match?(/sqlite/i)
|
||||||
|
|
||||||
change_column_default :custom_workflows, :active, from: true, to: 1
|
change_column_default :custom_workflows, :active, from: true, to: 1
|
||||||
CustomWorkflow.where(active: 't').each { |w| w.update(active: 1) }
|
CustomWorkflow.where(active: 't').update_all active: 1
|
||||||
CustomWorkflow.where(active: 'f').each { |w| w.update(active: 0) }
|
CustomWorkflow.where(active: 'f').update_all active: 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
return unless ActiveRecord::Base.connection.adapter_name.match?(/sqlite/i)
|
return unless ActiveRecord::Base.connection.adapter_name.match?(/sqlite/i)
|
||||||
|
|
||||||
change_column_default :custom_workflows, :active, from: 1, to: true
|
change_column_default :custom_workflows, :active, from: 1, to: true
|
||||||
CustomWorkflow.where(active: 1).each { |w| w.update(active: 't') }
|
CustomWorkflow.where(active: 1).update_all active: 't'
|
||||||
CustomWorkflow.where(active: 0).each { |w| w.update(active: 'f') }
|
CustomWorkflow.where(active: 0).update_all active: 'f'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user