Browse Source

Set inverse_of on project boards association.

git-svn-id: http://svn.redmine.org/redmine/trunk@16659 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang 7 years ago
parent
commit
261292445f
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      app/controllers/boards_controller.rb
  2. 1
    1
      app/models/project.rb

+ 1
- 1
app/controllers/boards_controller.rb View File

@@ -25,7 +25,7 @@ class BoardsController < ApplicationController
helper :watchers

def index
@boards = @project.boards.preload(:project, :last_message => :author).to_a
@boards = @project.boards.preload(:last_message => :author).to_a
# show the board if there is only one
if @boards.size == 1
@board = @boards.first

+ 1
- 1
app/models/project.rb View File

@@ -45,7 +45,7 @@ class Project < ActiveRecord::Base
has_many :documents, :dependent => :destroy
has_many :news, lambda {includes(:author)}, :dependent => :destroy
has_many :issue_categories, lambda {order(:name)}, :dependent => :delete_all
has_many :boards, lambda {order(:position)}, :dependent => :destroy
has_many :boards, lambda {order(:position)}, :inverse_of => :project, :dependent => :destroy
has_one :repository, lambda {where(:is_default => true)}
has_many :repositories, :dependent => :destroy
has_many :changesets, :through => :repository

Loading…
Cancel
Save