Few fixes.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1470 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
e119b324cc
commit
5f108dfb0f
4 files changed
+4
-4
No files matched your search
@@ -52,7 +52,7 @@ class ProjectsController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@project_tree = projects.group_by {|p| p.parent || p}
|
@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 {
|
format.atom {
|
||||||
render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i),
|
render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class AddEnumerationsPosition < ActiveRecord::Migration
|
class AddEnumerationsPosition < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
|
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|
|
enums.each_with_index do |enum, i|
|
||||||
# do not call model callbacks
|
# do not call model callbacks
|
||||||
Enumeration.update_all "position = #{i+1}", {:id => enum.id}
|
Enumeration.update_all "position = #{i+1}", {:id => enum.id}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class AddCustomFieldsPosition < ActiveRecord::Migration
|
class AddCustomFieldsPosition < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
add_column(:custom_fields, :position, :integer, :default => 1)
|
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|
|
fields.each_with_index do |field, i|
|
||||||
# do not call model callbacks
|
# do not call model callbacks
|
||||||
CustomField.update_all "position = #{i+1}", {:id => field.id}
|
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)
|
def initialize(object_name, object, template, options, proc)
|
||||||
set_language_if_valid options.delete(:lang)
|
set_language_if_valid options.delete(:lang)
|
||||||
@object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
(field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector|
|
(field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector|
|
||||||
|
|||||||
Reference in new issue
Block a user