@@ -43,15 +43,15 class Project < ActiveRecord::Base | |||||
43 | has_many :queries, :dependent => :delete_all |
|
43 | has_many :queries, :dependent => :delete_all | |
44 | has_many :documents, :dependent => :destroy |
|
44 | has_many :documents, :dependent => :destroy | |
45 | has_many :news, lambda {includes(:author)}, :dependent => :destroy |
|
45 | has_many :news, lambda {includes(:author)}, :dependent => :destroy | |
46 |
has_many :issue_categories, lambda {order( |
|
46 | has_many :issue_categories, lambda {order(:name)}, :dependent => :delete_all | |
47 |
has_many :boards, lambda {order( |
|
47 | has_many :boards, lambda {order(:position)}, :dependent => :destroy | |
48 |
has_one :repository, lambda {where( |
|
48 | has_one :repository, lambda {where(:is_default => true)} | |
49 | has_many :repositories, :dependent => :destroy |
|
49 | has_many :repositories, :dependent => :destroy | |
50 | has_many :changesets, :through => :repository |
|
50 | has_many :changesets, :through => :repository | |
51 | has_one :wiki, :dependent => :destroy |
|
51 | has_one :wiki, :dependent => :destroy | |
52 | # Custom field for the project issues |
|
52 | # Custom field for the project issues | |
53 | has_and_belongs_to_many :issue_custom_fields, |
|
53 | has_and_belongs_to_many :issue_custom_fields, | |
54 |
lambda {order( |
|
54 | lambda {order(:position)}, | |
55 | :class_name => 'IssueCustomField', |
|
55 | :class_name => 'IssueCustomField', | |
56 | :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", |
|
56 | :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", | |
57 | :association_foreign_key => 'custom_field_id' |
|
57 | :association_foreign_key => 'custom_field_id' |
General Comments 0
You need to be logged in to leave comments.
Login now