the second classic oops commit
This commit is contained in:
parent
a373af936b
commit
da7d23abd0
|
@ -1,7 +1,7 @@
|
||||||
class Git::BaseController < ApplicationController
|
class Git::BaseController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
before_filter :find_platfrom
|
before_filter :find_platform
|
||||||
before_filter :find_project
|
before_filter :find_project
|
||||||
before_filter :find_repository
|
before_filter :find_repository
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ class Git::BaseController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_project
|
def find_project
|
||||||
@project = Project.find_by_name!(params[:project_name])
|
@project = @platform.projects.find_by_name!(params[:project_name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_repository
|
def find_repository
|
||||||
|
|
|
@ -5,9 +5,13 @@ class Git::RepositoriesController < Git::BaseController
|
||||||
@tree = @commit.tree
|
@tree = @commit.tree
|
||||||
end
|
end
|
||||||
|
|
||||||
# def commits
|
protected
|
||||||
# branch_name = (params[:branch] ? params[:branch] : "master")
|
def find_platform
|
||||||
# @commits = @repository.commits(branch_name)
|
@platform = Platform.find params[:platform_id]
|
||||||
# end
|
end
|
||||||
|
|
||||||
|
def find_project
|
||||||
|
@project = Project.find params[:project_id]
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue