Patch #1932 ยป patch-0.7-stable-r1637.diff
| app/controllers/projects_controller.rb (Arbeitskopie) | ||
|---|---|---|
|
:conditions => Project.visible_by(User.current),
|
||
|
:include => :parent
|
||
|
@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]}
|
||
|
end
|
||
|
|
||
|
# Add a new project
|
||
| db/migrate/078_add_custom_fields_position.rb (Arbeitskopie) | ||
|---|---|---|
|
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 |fields|
|
||
|
fields.each_with_index do |field, i|
|
||
|
# do not call model callbacks
|
||
|
CustomField.update_all "position = #{i+1}", {:id => field.id}
|
||
| db/migrate/072_add_enumerations_position.rb (Arbeitskopie) | ||
|---|---|---|
|
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 |enums|
|
||
|
enums.each_with_index do |enum, i|
|
||
|
# do not call model callbacks
|
||
|
Enumeration.update_all "position = #{i+1}", {:id => enum.id}
|
||
| config/environment.rb (Arbeitskopie) | ||
|---|---|---|
|
# ENV['RAILS_ENV'] ||= 'production'
|
||
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
||
|
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
|
||
|
RAILS_GEM_VERSION = '2.0.4' unless defined? RAILS_GEM_VERSION
|
||
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
||
|
require File.join(File.dirname(__FILE__), 'boot')
|
||