Refactor: Split method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3535 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ca6df3d78d
commit
3a99f18913
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
class BoardsController < ApplicationController
|
class BoardsController < ApplicationController
|
||||||
default_search_scope :messages
|
default_search_scope :messages
|
||||||
before_filter :find_project, :authorize
|
before_filter :find_project, :find_board_if_available, :authorize
|
||||||
|
|
||||||
helper :messages
|
helper :messages
|
||||||
include MessagesHelper
|
include MessagesHelper
|
||||||
|
@ -90,6 +90,11 @@ private
|
||||||
|
|
||||||
def find_project
|
def find_project
|
||||||
@project = Project.find(params[:project_id])
|
@project = Project.find(params[:project_id])
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_board_if_available
|
||||||
@board = @project.boards.find(params[:id]) if params[:id]
|
@board = @project.boards.find(params[:id]) if params[:id]
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
|
|
Loading…
Reference in New Issue