the second classic oops commit
This commit is contained in:
parent
a373af936b
commit
da7d23abd0
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue