##// END OF EJS Templates
tagged version 3.3.1...
tagged version 3.3.1 git-svn-id: http://svn.redmine.org/redmine/tags/3.3.1@15904 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r13100:2d1866d966d9
r15522:93cd8829a79f 3.3.1
Show More
078_add_custom_fields_position.rb
15 lines | 448 B | text/x-ruby | RubyLexer
/ db / migrate / 078_add_custom_fields_position.rb
Jean-Philippe Lang
Custom fields can now be reordered....
r888 class AddCustomFieldsPosition < ActiveRecord::Migration
def self.up
add_column(:custom_fields, :position, :integer, :default => 1)
Jean-Philippe Lang
Replaces find(:all) calls....
r10691 CustomField.all.group_by(&:type).each do |t, fields|
Jean-Philippe Lang
Custom fields can now be reordered....
r888 fields.each_with_index do |field, i|
# do not call model callbacks
Jean-Philippe Lang
Merged rails-4.1 branch (#14534)....
r13100 CustomField.where({:id => field.id}).update_all("position = #{i+1}")
Jean-Philippe Lang
Custom fields can now be reordered....
r888 end
end
end
def self.down
remove_column :custom_fields, :position
end
end