Use Rails.root.join where appropriate

This commit is contained in:
Robert Speicher 2012-09-26 14:52:01 -04:00
parent 82c3f62603
commit afc4a75499
11 changed files with 17 additions and 17 deletions

View file

@ -105,7 +105,7 @@ class ApplicationController < ActionController::Base
end
def render_404
render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
render file: Rails.root.join("public", "404"), layout: false, status: "404"
end
def require_non_empty_project

View file

@ -1,4 +1,4 @@
require File.join(Rails.root, "app/models/commit")
require Rails.root.join("app/models/commit")
class MergeRequest < ActiveRecord::Base
include IssueCommonality

View file

@ -155,7 +155,7 @@ module Repository
# Build file path
file_name = self.code + "-" + commit.id.to_s + ".tar.gz"
storage_path = File.join(Rails.root, "tmp", "repositories", self.code)
storage_path = Rails.root.join("tmp", "repositories", self.code)
file_path = File.join(storage_path, file_name)
# Put files into a directory before archiving