diff options
-rw-r--r-- | app/controllers/boards_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index a2bbcbbcf..e8770b2ae 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -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 diff --git a/app/models/project.rb b/app/models/project.rb index 1e187da1f..8afc686c7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 |