提交 6943abb3 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #30887 from bogdanvlviv/use-__dir__-in-activestorage

Use __dir__  in activestorage/
......@@ -3,5 +3,5 @@
require_relative "create_users_migration"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Migrator.migrate File.expand_path("../../../db/migrate", __FILE__)
ActiveRecord::Migrator.migrate File.expand_path("../../db/migrate", __dir__)
ActiveStorageCreateUsers.migrate(:up)
#!/usr/bin/env ruby
# frozen_string_literal: true
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
load Gem.bin_path("bundler", "bundle")
# frozen_string_literal: true
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
require_relative "dummy/config/environment.rb"
require "bundler/setup"
require "active_support"
......@@ -23,7 +23,7 @@
require "yaml"
SERVICE_CONFIGURATIONS = begin
erb = ERB.new(Pathname.new(File.expand_path("../service/configurations.yml", __FILE__)).read)
erb = ERB.new(Pathname.new(File.expand_path("service/configurations.yml", __dir__)).read)
configuration = YAML.load(erb.result) || {}
configuration.deep_symbolize_keys
rescue Errno::ENOENT
......@@ -38,7 +38,7 @@
ActiveStorage.verifier = ActiveSupport::MessageVerifier.new("Testing")
class ActiveSupport::TestCase
self.file_fixture_path = File.expand_path("../fixtures/files", __FILE__)
self.file_fixture_path = File.expand_path("fixtures/files", __dir__)
private
def create_blob(data: "Hello world!", filename: "hello.txt", content_type: "text/plain")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册