Refactor: Split the find_object methods to prep for a larger refactoring.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3591 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-03-16 15:17:47 +00:00
parent 6b88de1234
commit e6c8760ad7
8 changed files with 24 additions and 16 deletions
@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueRelationsController < ApplicationController
before_filter :find_project, :authorize
before_filter :find_issue, :find_project_from_association, :authorize
def new
@relation = IssueRelation.new(params[:relation])
@@ -52,9 +52,8 @@ class IssueRelationsController < ApplicationController
end
private
def find_project
@issue = Issue.find(params[:issue_id])
@project = @issue.project
def find_issue
@issue = @object = Issue.find(params[:issue_id])
rescue ActiveRecord::RecordNotFound
render_404
end