the second classic oops commit

This commit is contained in:
Timothy N. Tsvetkov 2011-03-10 17:22:53 +03:00
parent a373af936b
commit da7d23abd0
2 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
class Git::BaseController < ApplicationController
before_filter :authenticate_user!
before_filter :find_platfrom
before_filter :find_platform
before_filter :find_project
before_filter :find_repository
@ -11,7 +11,7 @@ class Git::BaseController < ApplicationController
end
def find_project
@project = Project.find_by_name!(params[:project_name])
@project = @platform.projects.find_by_name!(params[:project_name])
end
def find_repository

View File

@ -5,9 +5,13 @@ class Git::RepositoriesController < Git::BaseController
@tree = @commit.tree
end
# def commits
# branch_name = (params[:branch] ? params[:branch] : "master")
# @commits = @repository.commits(branch_name)
# end
protected
def find_platform
@platform = Platform.find params[:platform_id]
end
def find_project
@project = Project.find params[:project_id]
end
end