diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-04 17:58:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-04 17:58:14 +0000 |
commit | 7cdd88a6ce3632c801223b33e5ccc2b9fc13651e (patch) | |
tree | a270478d7d7626ac9970d69e32cac6c6807e6cf4 /db/migrate/072_add_enumerations_position.rb | |
parent | 22558f77094dce4d489dac410abd7b74e48cdcb0 (diff) | |
download | redmine-7cdd88a6ce3632c801223b33e5ccc2b9fc13651e.tar.gz redmine-7cdd88a6ce3632c801223b33e5ccc2b9fc13651e.zip |
Merged Rails 2.1 compatibility branch.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1623 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/072_add_enumerations_position.rb')
-rw-r--r-- | db/migrate/072_add_enumerations_position.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/072_add_enumerations_position.rb b/db/migrate/072_add_enumerations_position.rb index e0beaf395..22558a6e9 100644 --- a/db/migrate/072_add_enumerations_position.rb +++ b/db/migrate/072_add_enumerations_position.rb @@ -1,7 +1,7 @@ class AddEnumerationsPosition < ActiveRecord::Migration def self.up add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position') - Enumeration.find(:all).group_by(&:opt).each_value do |enums| + Enumeration.find(:all).group_by(&:opt).each do |opt, enums| enums.each_with_index do |enum, i| # do not call model callbacks Enumeration.update_all "position = #{i+1}", {:id => enum.id} |