Project

General

Profile

Patch #1932 ยป patch-0.7-stable-r1637.diff

Kai Krakow, 2008-09-22 12:18

View differences:

app/controllers/projects_controller.rb (Arbeitskopie)
55 55
                            :conditions => Project.visible_by(User.current),
56 56
                            :include => :parent
57 57
    @project_tree = projects.group_by {|p| p.parent || p}
58
    @project_tree.each_key {|p| @project_tree[p] -= [p]}
58
    @project_tree.keys.each {|p| @project_tree[p] -= [p]}
59 59
  end
60 60
  
61 61
  # Add a new project
db/migrate/078_add_custom_fields_position.rb (Arbeitskopie)
1 1
class AddCustomFieldsPosition < ActiveRecord::Migration
2 2
  def self.up
3 3
    add_column(:custom_fields, :position, :integer, :default => 1)
4
    CustomField.find(:all).group_by(&:type).each_value  do |fields|
4
    CustomField.find(:all).group_by(&:type).each  do |fields|
5 5
      fields.each_with_index do |field, i|
6 6
        # do not call model callbacks
7 7
        CustomField.update_all "position = #{i+1}", {:id => field.id}
db/migrate/072_add_enumerations_position.rb (Arbeitskopie)
1 1
class AddEnumerationsPosition < ActiveRecord::Migration
2 2
  def self.up
3 3
    add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
4
    Enumeration.find(:all).group_by(&:opt).each_value  do |enums|
4
    Enumeration.find(:all).group_by(&:opt).each  do |enums|
5 5
      enums.each_with_index do |enum, i|
6 6
        # do not call model callbacks
7 7
        Enumeration.update_all "position = #{i+1}", {:id => enum.id}
config/environment.rb (Arbeitskopie)
5 5
# ENV['RAILS_ENV'] ||= 'production'
6 6

  
7 7
# Specifies gem version of Rails to use when vendor/rails is not present
8
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
8
RAILS_GEM_VERSION = '2.0.4' unless defined? RAILS_GEM_VERSION
9 9

  
10 10
# Bootstrap the Rails environment, frameworks, and default configuration
11 11
require File.join(File.dirname(__FILE__), 'boot')
    (1-1/1)