16470: Applies changes from 'rails app:update'.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 5 Aug 2020 18:39:47 +0000 (15:39 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 24 Aug 2020 15:21:28 +0000 (12:21 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

apps/workbench/bin/yarn [new file with mode: 0755]
apps/workbench/config/application.rb
apps/workbench/config/initializers/new_framework_defaults_5_1.rb [new file with mode: 0644]
apps/workbench/config/routes.rb
services/api/config/application.rb

diff --git a/apps/workbench/bin/yarn b/apps/workbench/bin/yarn
new file mode 100755 (executable)
index 0000000..7874468
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+VENDOR_PATH = File.expand_path('..', __dir__)
+Dir.chdir(VENDOR_PATH) do
+  begin
+    exec "yarnpkg #{ARGV.join(" ")}"
+  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
+end
index e88229b85158f200ebc6a7df644f9b147fcfd06f..18e6ef38d81dd92b0c0e2d96e0cfb9b6ddf13b31 100644 (file)
@@ -9,6 +9,8 @@ require "rails"
 require "active_model/railtie"
 require "active_job/railtie"
 require "active_record/railtie"
+# Skip ActiveStorage (new in Rails 5.1)
+# require "active_storage/engine"
 require "action_controller/railtie"
 require "action_mailer/railtie"
 require "action_view/railtie"
@@ -28,6 +30,9 @@ module ArvadosWorkbench
 
     require_relative "arvados_config.rb"
 
+    # Initialize configuration defaults for originally generated Rails version.
+    config.load_defaults 5.1
+
     # Settings in config/environments/* take precedence over those specified here.
     # Application configuration should go into files in config/initializers
     # -- all .rb files in that directory are automatically loaded.
diff --git a/apps/workbench/config/initializers/new_framework_defaults_5_1.rb b/apps/workbench/config/initializers/new_framework_defaults_5_1.rb
new file mode 100644 (file)
index 0000000..804ee6f
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+# Be sure to restart your server when you modify this file.
+#
+# This file contains migration options to ease your Rails 5.1 upgrade.
+#
+# Once upgraded flip defaults one by one to migrate to the new default.
+#
+# Read the Guide for Upgrading Ruby on Rails for more info on each option.
+
+# Make `form_with` generate non-remote forms.
+Rails.application.config.action_view.form_with_generates_remote_forms = false
+
+# Unknown asset fallback will return the path passed in when the given
+# asset is not present in the asset pipeline.
+# Rails.application.config.assets.unknown_asset_fallback = false
index 718adfd2ed0583a99f8eebb221b5eae0c7d012c3..ffc09ac933acf8d88fa1b07cac460c144a805a45 100644 (file)
@@ -2,7 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-ArvadosWorkbench::Application.routes.draw do
+Rails.application.routes.draw do
   themes_for_rails
 
   resources :keep_disks
index 369294e8a79278ffb437571e74cb726af527e845..b28ae0e0718e2ddabc472f61be8cf8c07a53232f 100644 (file)
@@ -16,7 +16,7 @@ require "sprockets/railtie"
 require "rails/test_unit/railtie"
 # Skipping the following:
 # * ActionCable (new in Rails 5.0) as it adds '/cable' routes that we're not using
-# * Skip ActiveStorage (new in Rails 5.1)
+# * ActiveStorage (new in Rails 5.1)
 
 require 'digest'