diff --git a/app/models/domain_status.rb b/app/models/domain_status.rb index dc3032c74..4b1c49916 100644 --- a/app/models/domain_status.rb +++ b/app/models/domain_status.rb @@ -1,6 +1,5 @@ class DomainStatus < ApplicationRecord include EppErrors - belongs_to :domain # Requests to delete the object MUST be rejected. diff --git a/bin/bundle b/bin/bundle index f19acf5b5..8bfc37be6 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,3 @@ #!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__) load Gem.bin_path('bundler', 'bundle') diff --git a/bin/setup b/bin/setup index 94fd4d797..ab3c84d9b 100755 --- a/bin/setup +++ b/bin/setup @@ -1,9 +1,11 @@ #!/usr/bin/env ruby -require 'fileutils' +# frozen_string_literal: true + +require 'pathname' include FileUtils # path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +APP_ROOT = Pathname.new File.expand_path('../../', __dir__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") @@ -20,10 +22,10 @@ chdir APP_ROOT do # Install JavaScript dependencies if using Yarn # system('bin/yarn') - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' - # end + puts "\n== Copying sample files ==" + unless File.exist?('config/database.yml') + system! 'cp config/database.yml.sample config/database.yml' + end puts "\n== Preparing database ==" system! 'bin/rails db:setup' diff --git a/bin/update b/bin/update index 58bfaed51..a8e4462f2 100755 --- a/bin/update +++ b/bin/update @@ -1,9 +1,10 @@ #!/usr/bin/env ruby +require 'pathname' require 'fileutils' include FileUtils # path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") @@ -17,9 +18,6 @@ chdir APP_ROOT do system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') - puts "\n== Updating database ==" system! 'bin/rails db:migrate' diff --git a/bin/yarn b/bin/yarn index 460dd565b..adabdd976 100755 --- a/bin/yarn +++ b/bin/yarn @@ -1,11 +1,9 @@ #!/usr/bin/env ruby APP_ROOT = File.expand_path('..', __dir__) Dir.chdir(APP_ROOT) do - begin - exec "yarnpkg", *ARGV - rescue Errno::ENOENT - $stderr.puts "Yarn executable was not detected in the system." - $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end + exec 'yarnpkg', *ARGV +rescue Errno::ENOENT + $stderr.puts 'Yarn executable was not detected in the system.' + $stderr.puts 'Download Yarn at https://yarnpkg.com/en/docs/install' + exit 1 end