1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-10-17 17:01:01 +00:00

Set inverse_of on project boards association.

git-svn-id: http://svn.redmine.org/redmine/trunk@16659 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-06-10 23:47:15 +00:00
parent 08e2f2bf96
commit 261292445f
2 changed files with 2 additions and 2 deletions

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

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