mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-11 19:53:07 +00:00
Few fixes.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1470 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e119b324cc
commit
5f108dfb0f
@ -52,7 +52,7 @@ class ProjectsController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@project_tree = projects.group_by {|p| p.parent || p}
|
||||
@project_tree.each_key {|p| @project_tree[p] -= [p]}
|
||||
@project_tree.keys.each {|p| @project_tree[p] -= [p]}
|
||||
}
|
||||
format.atom {
|
||||
render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i),
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
class AddCustomFieldsPosition < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column(:custom_fields, :position, :integer, :default => 1)
|
||||
CustomField.find(:all).group_by(&:type).each_value do |fields|
|
||||
CustomField.find(:all).group_by(&:type).each do |t, fields|
|
||||
fields.each_with_index do |field, i|
|
||||
# do not call model callbacks
|
||||
CustomField.update_all "position = #{i+1}", {:id => field.id}
|
||||
|
||||
@ -22,7 +22,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
|
||||
|
||||
def initialize(object_name, object, template, options, proc)
|
||||
set_language_if_valid options.delete(:lang)
|
||||
@object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
|
||||
super
|
||||
end
|
||||
|
||||
(field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user