diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-17 06:57:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-17 06:57:20 +0000 |
commit | 64afa24a7f72526a2cbf6761e51b6cd326aa0c36 (patch) | |
tree | e0766ba52e537838fb6c06c09e81b10010690b09 /db/migrate/20160416072926_remove_position_defaults.rb | |
parent | f2eb979f66da758fbed7d98ae970f7ef74d1263f (diff) | |
download | redmine-64afa24a7f72526a2cbf6761e51b6cd326aa0c36.tar.gz redmine-64afa24a7f72526a2cbf6761e51b6cd326aa0c36.zip |
Replaces acts_as_list with an implementation that handles #position= (#12909).
Objects are reordered using the regular attribute writer #position= and AR callbacks.
git-svn-id: http://svn.redmine.org/redmine/trunk@15335 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/20160416072926_remove_position_defaults.rb')
-rw-r--r-- | db/migrate/20160416072926_remove_position_defaults.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20160416072926_remove_position_defaults.rb b/db/migrate/20160416072926_remove_position_defaults.rb new file mode 100644 index 000000000..ab3af1499 --- /dev/null +++ b/db/migrate/20160416072926_remove_position_defaults.rb @@ -0,0 +1,13 @@ +class RemovePositionDefaults < ActiveRecord::Migration + def up + [Board, CustomField, Enumeration, IssueStatus, Role, Tracker].each do |klass| + change_column klass.table_name, :position, :integer, :default => nil + end + end + + def down + [Board, CustomField, Enumeration, IssueStatus, Role, Tracker].each do |klass| + change_column klass.table_name, :position, :integer, :default => 1 + end + end +end |