Commit 3316f2d5 by John Donnal

upgraded rails to 7.0

parent c42d259d
...@@ -2,7 +2,7 @@ source 'https://rubygems.org' ...@@ -2,7 +2,7 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1' gem 'rails', '~> 7.0.5'
# Use SCSS for stylesheets # Use SCSS for stylesheets
#gem 'sass-rails' #, '~> 5.0' #gem 'sass-rails' #, '~> 5.0'
......
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (6.1.7.3) actioncable (7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.3) actionmailbox (7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
activejob (= 6.1.7.3) activejob (= 7.0.5)
activerecord (= 6.1.7.3) activerecord (= 7.0.5)
activestorage (= 6.1.7.3) activestorage (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
mail (>= 2.7.1) mail (>= 2.7.1)
actionmailer (6.1.7.3) net-imap
actionpack (= 6.1.7.3) net-pop
actionview (= 6.1.7.3) net-smtp
activejob (= 6.1.7.3) actionmailer (7.0.5)
activesupport (= 6.1.7.3) actionpack (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activesupport (= 7.0.5)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (6.1.7.3) actionpack (7.0.5)
actionview (= 6.1.7.3) actionview (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
rack (~> 2.0, >= 2.0.9) rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.3) actiontext (7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
activerecord (= 6.1.7.3) activerecord (= 7.0.5)
activestorage (= 6.1.7.3) activestorage (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (6.1.7.3) actionview (7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.3) activejob (7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (6.1.7.3) activemodel (7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
activerecord (6.1.7.3) activerecord (7.0.5)
activemodel (= 6.1.7.3) activemodel (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
activestorage (6.1.7.3) activestorage (7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
activejob (= 6.1.7.3) activejob (= 7.0.5)
activerecord (= 6.1.7.3) activerecord (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
marcel (~> 1.0) marcel (~> 1.0)
mini_mime (>= 1.1.0) mini_mime (>= 1.1.0)
activesupport (6.1.7.3) activesupport (7.0.5)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.4) addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.4.1) airbrussh (1.4.1)
...@@ -281,33 +287,33 @@ GEM ...@@ -281,33 +287,33 @@ GEM
rack (>= 2.0.0) rack (>= 2.0.0)
rack-test (2.1.0) rack-test (2.1.0)
rack (>= 1.3) rack (>= 1.3)
rails (6.1.7.3) rails (7.0.5)
actioncable (= 6.1.7.3) actioncable (= 7.0.5)
actionmailbox (= 6.1.7.3) actionmailbox (= 7.0.5)
actionmailer (= 6.1.7.3) actionmailer (= 7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
actiontext (= 6.1.7.3) actiontext (= 7.0.5)
actionview (= 6.1.7.3) actionview (= 7.0.5)
activejob (= 6.1.7.3) activejob (= 7.0.5)
activemodel (= 6.1.7.3) activemodel (= 7.0.5)
activerecord (= 6.1.7.3) activerecord (= 7.0.5)
activestorage (= 6.1.7.3) activestorage (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 6.1.7.3) railties (= 7.0.5)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0) rails-html-sanitizer (1.6.0)
loofah (~> 2.21) loofah (~> 2.21)
nokogiri (~> 1.14) nokogiri (~> 1.14)
railties (6.1.7.3) railties (7.0.5)
actionpack (= 6.1.7.3) actionpack (= 7.0.5)
activesupport (= 6.1.7.3) activesupport (= 7.0.5)
method_source method_source
rake (>= 12.2) rake (>= 12.2)
thor (~> 1.0) thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.0.6)
rb-fsevent (0.11.2) rb-fsevent (0.11.2)
...@@ -386,13 +392,6 @@ GEM ...@@ -386,13 +392,6 @@ GEM
spring (4.1.1) spring (4.1.1)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
spring (>= 0.9.1) spring (>= 0.9.1)
sprockets (4.2.0)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.6.3) sqlite3 (1.6.3)
mini_portile2 (~> 2.8.0) mini_portile2 (~> 2.8.0)
sqlite3 (1.6.3-x64-mingw32) sqlite3 (1.6.3-x64-mingw32)
...@@ -478,7 +477,7 @@ DEPENDENCIES ...@@ -478,7 +477,7 @@ DEPENDENCIES
oj oj
pg pg
rack-cors rack-cors
rails (~> 6.1) rails (~> 7.0.5)
rspec-json_expectations rspec-json_expectations
rspec-rails rspec-rails
rubocop rubocop
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__) APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot" require_relative "../config/boot"
require "rails/commands" require "rails/commands"
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "fileutils" require "fileutils"
# path to your application root. # path to your application root.
APP_ROOT = File.expand_path('..', __dir__) APP_ROOT = File.expand_path("..", __dir__)
def system!(*args) def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==") system(*args) || abort("\n== Command #{args} failed ==")
...@@ -13,21 +13,21 @@ FileUtils.chdir APP_ROOT do ...@@ -13,21 +13,21 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at any time and get an expectable outcome. # This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file. # Add necessary setup steps to this file.
puts '== Installing dependencies ==' puts "== Installing dependencies =="
system! 'gem install bundler --conservative' system! "gem install bundler --conservative"
system('bundle check') || system!('bundle install') system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml') # unless File.exist?("config/database.yml")
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml' # FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end # end
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system! 'bin/rails db:prepare' system! "bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles ==" puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear' system! "bin/rails log:clear tmp:clear"
puts "\n== Restarting application server ==" puts "\n== Restarting application server =="
system! 'bin/rails restart' system! "bin/rails restart"
end end
...@@ -3,7 +3,7 @@ require_relative "boot" ...@@ -3,7 +3,7 @@ require_relative "boot"
require "rails" require "rails"
# Pick the frameworks you want: # Pick the frameworks you want:
require "active_model/railtie" require "active_model/railtie"
# require "active_job/railtie" require "active_job/railtie"
require "active_record/railtie" require "active_record/railtie"
require "active_storage/engine" require "active_storage/engine"
require "action_controller/railtie" require "action_controller/railtie"
...@@ -12,7 +12,6 @@ require "action_mailbox/engine" ...@@ -12,7 +12,6 @@ require "action_mailbox/engine"
# require "action_text/engine" # require "action_text/engine"
require "action_view/railtie" require "action_view/railtie"
# require "action_cable/engine" # require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie" require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
...@@ -22,7 +21,9 @@ Bundler.require(*Rails.groups) ...@@ -22,7 +21,9 @@ Bundler.require(*Rails.groups)
module ControlPanel module ControlPanel
class Application < Rails::Application class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version. # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1 config.load_defaults 7.0
config.active_support.cache_format_version = 7.0
config.middleware.use Rack::Deflater config.middleware.use Rack::Deflater
...@@ -46,8 +47,8 @@ module ControlPanel ...@@ -46,8 +47,8 @@ module ControlPanel
permission user_group user data_view joule_modules event_stream).each do |service| permission user_group user data_view joule_modules event_stream).each do |service|
config.autoload_paths << Rails.root.join("app/services/#{service}") config.autoload_paths << Rails.root.join("app/services/#{service}")
end end
config.autoload_paths << Rails.root.join("app/adapters/nilmdb") #config.autoload_paths << Rails.root.join("app/adapters/nilmdb")
config.autoload_paths << Rails.root.join("app/adapters/joule") #config.autoload_paths << Rails.root.join("app/adapters/joule")
#config.autoload_paths << Rails.root.join("app/adapters/nilmdb") #config.autoload_paths << Rails.root.join("app/adapters/nilmdb")
end end
......
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile. require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations. require "bootsnap/setup" # Speed up boot time by caching expensive operations.
...@@ -14,12 +14,15 @@ Rails.application.configure do ...@@ -14,12 +14,15 @@ Rails.application.configure do
# Show full error reports. # Show full error reports.
config.consider_all_requests_local = true config.consider_all_requests_local = true
# Enable server timing
config.server_timing = true
# Enable/disable caching. By default caching is disabled. # Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching. # Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist? if Rails.root.join("tmp/caching-dev.txt").exist?
config.cache_store = :memory_store config.cache_store = :memory_store
config.public_file_server.headers = { config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}" "Cache-Control" => "public, max-age=#{2.days.to_i}"
} }
else else
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
...@@ -61,10 +64,6 @@ Rails.application.configure do ...@@ -61,10 +64,6 @@ Rails.application.configure do
# Annotate rendered view with file names. # Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true # config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Uncomment if you wish to allow Action Cable access from any origin. # Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true # config.action_cable.disable_request_forgery_protection = true
# #
......
...@@ -21,14 +21,14 @@ Rails.application.configure do ...@@ -21,14 +21,14 @@ Rails.application.configure do
# Disable serving static files from the `/public` folder by default since # Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this. # Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = 'http://assets.example.com' # config.asset_host = "http://assets.example.com"
# Specifies the header that your server uses for sending files. # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options). # Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local config.active_storage.service = :local
...@@ -60,21 +60,15 @@ Rails.application.configure do ...@@ -60,21 +60,15 @@ Rails.application.configure do
# the I18n.default_locale when a translation cannot be found). # the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true config.i18n.fallbacks = true
# Send deprecation notices to registered listeners. # Don't log any deprecations.
config.active_support.deprecation = :notify config.active_support.report_deprecations = false
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups. # Use a different logger for distributed setups.
# require "syslog/logger" # require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
if ENV["RAILS_LOG_TO_STDOUT"].present? if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT) logger = ActiveSupport::Logger.new(STDOUT)
......
...@@ -8,17 +8,18 @@ require "active_support/core_ext/integer/time" ...@@ -8,17 +8,18 @@ require "active_support/core_ext/integer/time"
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
# Turn false under Spring and add config.action_view.cache_template_loading = true.
config.cache_classes = true config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application # Eager loading loads your whole application. When running a single test locally,
# just for the purpose of running a single test. If you are using a tool that # this probably isn't necessary. It's a good idea to do in a continuous integration
# preloads Rails for running tests, you may have to set it to true. # system, or in some way before deploying your code.
config.eager_load = false config.eager_load = ENV["CI"].present?
# Configure public file server for tests with Cache-Control for performance. # Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true config.public_file_server.enabled = true
config.public_file_server.headers = { config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}" "Cache-Control" => "public, max-age=#{1.hour.to_i}"
} }
# Show full error reports and disable caching. # Show full error reports and disable caching.
......
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
# notations and behaviors.
Rails.application.config.filter_parameters += [:password] Rails.application.config.filter_parameters += [:password]
Rails.application.config.filter_parameters << lambda do |key, value| Rails.application.config.filter_parameters << lambda do |key, value|
value.replace('[BASE64 STRING OMITTED]') if key == 'redux_json' || key == 'image' value.replace('[BASE64 STRING OMITTED]') if key == 'redux_json' || key == 'image'
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
# are locale specific, and you may define rules for as many different # are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default: # locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect| # ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en' # inflect.plural /^(ox)$/i, "\\1en"
# inflect.singular /^(ox)en/i, '\1' # inflect.singular /^(ox)en/i, "\\1"
# inflect.irregular 'person', 'people' # inflect.irregular "person", "people"
# inflect.uncountable %w( fish sheep ) # inflect.uncountable %w( fish sheep )
# end # end
# These inflection rules are supported but not enabled by default: # These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect| # ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful' # inflect.acronym "RESTful"
# end # end
# Be sure to restart your server when you modify this file.
#
# This file eases your Rails 7.0 framework defaults upgrade.
#
# Uncomment each configuration one by one to switch to the new default.
# Once your application is ready to run with all new defaults, you can remove
# this file and set the `config.load_defaults` to `7.0`.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
# `button_to` view helper will render `<button>` element, regardless of whether
# or not the content is passed as the first argument or as a block.
Rails.application.config.action_view.button_to_generates_button_tag = true
# `stylesheet_link_tag` view helper will not render the media attribute by default.
Rails.application.config.action_view.apply_stylesheet_media_default = false
# Change the digest class for the key generators to `OpenSSL::Digest::SHA256`.
# Changing this default means invalidate all encrypted messages generated by
# your application and, all the encrypted cookies. Only change this after you
# rotated all the messages using the key rotator.
#
# See upgrading guide for more information on how to build a rotator.
# https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html
Rails.application.config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
# Change the digest class for ActiveSupport::Digest.
# Changing this default means that for example Etags change and
# various cache keys leading to cache invalidation.
Rails.application.config.active_support.hash_digest_class = OpenSSL::Digest::SHA256
# Don't override ActiveSupport::TimeWithZone.name and use the default Ruby
# implementation.
Rails.application.config.active_support.remove_deprecated_time_with_zone_name = true
# Calls `Rails.application.executor.wrap` around test cases.
# This makes test cases behave closer to an actual request or job.
# Several features that are normally disabled in test, such as Active Record query cache
# and asynchronous queries will then be enabled.
Rails.application.config.active_support.executor_around_test_case = true
# Define the isolation level of most of Rails internal state.
# If you use a fiber based server or job processor, you should set it to `:fiber`.
# Otherwise the default of `:thread` if preferable.
Rails.application.config.active_support.isolation_level = :thread
# Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
Rails.application.config.action_mailer.smtp_timeout = 5
# The ActiveStorage video previewer will now use scene change detection to generate
# better preview images (rather than the previous default of using the first frame
# of the video).
Rails.application.config.active_storage.video_preview_arguments =
"-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1' -frames:v 1 -f image2"
# Automatically infer `inverse_of` for associations with a scope.
Rails.application.config.active_record.automatic_scope_inversing = true
# Raise when running tests if fixtures contained foreign key violations
Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true
# Disable partial inserts.
# This default means that all columns will be referenced in INSERT queries
# regardless of whether they have a default or not.
Rails.application.config.active_record.partial_inserts = false
# Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`.
Rails.application.config.action_controller.raise_on_open_redirects = true
# Change the variant processor for Active Storage.
# Changing this default means updating all places in your code that
# generate variants to use image processing macros and ruby-vips
# operations. See the upgrading guide for detail on the changes required.
# The `:mini_magick` option is not deprecated; it's fine to keep using it.
Rails.application.config.active_storage.variant_processor = :vips
# Enable parameter wrapping for JSON.
# Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
# To disable parameter wrapping entirely, set this config to `false`.
# Rails.application.config.action_controller.wrap_parameters_by_default = true
# Specifies whether generated namespaced UUIDs follow the RFC 4122 standard for namespace IDs provided as a
# `String` to `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5` method calls.
#
# See https://guides.rubyonrails.org/configuring.html#config-active-support-use-rfc4122-namespaced-uuids for
# more information.
Rails.application.config.active_support.use_rfc4122_namespaced_uuids = true
# Change the default headers to disable browsers' flawed legacy XSS protection.
Rails.application.config.action_dispatch.default_headers = {
"X-Frame-Options" => "SAMEORIGIN",
"X-XSS-Protection" => "0",
"X-Content-Type-Options" => "nosniff",
"X-Download-Options" => "noopen",
"X-Permitted-Cross-Domain-Policies" => "none",
"Referrer-Policy" => "strict-origin-when-cross-origin"
}
# ** Please read carefully, this must be configured in config/application.rb **
# Change the format of the cache entry.
# Changing this default means that all new cache entries added to the cache
# will have a different format that is not supported by Rails 6.1 applications.
# Only change this value after your application is fully deployed to Rails 7.0
# and you have no plans to rollback.
# When you're ready to change format, add this to `config/application.rb` (NOT this file):
# config.active_support.cache_format_version = 7.0
# Cookie serializer: 2 options
#
# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
# is `:marshal`. The default for new apps is `:json`.
#
# Rails.application.config.action_dispatch.cookies_serializer = :json
#
#
# To migrate an existing application to the `:json` serializer, use the `:hybrid` option.
#
# Rails transparently deserializes existing (Marshal-serialized) cookies on read and
# re-writes them in the JSON format.
#
# It is fine to use `:hybrid` long term; you should do that until you're confident *all* your cookies
# have been converted to JSON. To keep using `:hybrid` long term, move this config to its own
# initializer or to `config/application.rb`.
#
# Rails.application.config.action_dispatch.cookies_serializer = :hybrid
#
#
# If your cookies can't yet be serialized to JSON, keep using `:marshal` for backward-compatibility.
#
# If you have configured the serializer elsewhere, you can remove this section of the file.
#
# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
# Change the return value of `ActionDispatch::Request#content_type` to the Content-Type header without modification.
# Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type = false
# Active Storage `has_many_attached` relationships will default to replacing the current collection instead of appending to it.
# Thus, to support submitting an empty collection, the `file_field` helper will render an hidden field `include_hidden` by default when `multiple_file_field_include_hidden` is set to `true`.
# See https://guides.rubyonrails.org/configuring.html#config-active-storage-multiple-file-field-include-hidden for more information.
# Rails.application.config.active_storage.multiple_file_field_include_hidden = true
# ** Please read carefully, this must be configured in config/application.rb (NOT this file) **
# Disables the deprecated #to_s override in some Ruby core classes
# See https://guides.rubyonrails.org/configuring.html#config-active-support-disable-to-s-conversion for more information.
# config.active_support.disable_to_s_conversion = true
# This migration comes from active_storage (originally 20211119233751)
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
change_column_null(:active_storage_blobs, :checksum, true)
end
end
...@@ -10,14 +10,13 @@ ...@@ -10,14 +10,13 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_06_19_132452) do ActiveRecord::Schema[7.0].define(version: 2023_06_19_150859) do
create_table "data_apps", force: :cascade do |t| create_table "data_apps", force: :cascade do |t|
t.string "name" t.string "name"
t.string "joule_id" t.string "joule_id"
t.integer "nilm_id" t.integer "nilm_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.index ["nilm_id"], name: "index_data_apps_on_nilm_id" t.index ["nilm_id"], name: "index_data_apps_on_nilm_id"
end end
...@@ -27,8 +26,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -27,8 +26,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.string "description" t.string "description"
t.text "image" t.text "image"
t.text "redux_json" t.text "redux_json"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.string "visibility" t.string "visibility"
end end
...@@ -45,8 +44,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -45,8 +44,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.integer "total_rows", limit: 8 t.integer "total_rows", limit: 8
t.integer "total_time", limit: 8 t.integer "total_time", limit: 8
t.integer "db_stream_id" t.integer "db_stream_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.integer "level", limit: 8 t.integer "level", limit: 8
t.string "data_type" t.string "data_type"
end end
...@@ -60,8 +59,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -60,8 +59,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.float "scale_factor" t.float "scale_factor"
t.float "offset" t.float "offset"
t.integer "db_stream_id" t.integer "db_stream_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.boolean "plottable" t.boolean "plottable"
t.string "display_type" t.string "display_type"
end end
...@@ -69,8 +68,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -69,8 +68,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
create_table "db_folders", force: :cascade do |t| create_table "db_folders", force: :cascade do |t|
t.string "name" t.string "name"
t.string "description" t.string "description"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.integer "parent_id" t.integer "parent_id"
t.string "path" t.string "path"
t.boolean "hidden" t.boolean "hidden"
...@@ -87,8 +86,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -87,8 +86,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.string "name" t.string "name"
t.string "description" t.string "description"
t.integer "db_folder_id" t.integer "db_folder_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.string "path" t.string "path"
t.integer "start_time", limit: 8 t.integer "start_time", limit: 8
t.integer "end_time", limit: 8 t.integer "end_time", limit: 8
...@@ -108,8 +107,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -108,8 +107,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
create_table "dbs", force: :cascade do |t| create_table "dbs", force: :cascade do |t|
t.string "url" t.string "url"
t.integer "db_folder_id" t.integer "db_folder_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.integer "nilm_id" t.integer "nilm_id"
t.integer "size_total", limit: 8 t.integer "size_total", limit: 8
t.integer "size_db", limit: 8 t.integer "size_db", limit: 8
...@@ -129,8 +128,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -129,8 +128,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.integer "joule_id" t.integer "joule_id"
t.string "name" t.string "name"
t.string "description" t.string "description"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", null: false
t.integer "event_count" t.integer "event_count"
t.string "event_fields_json" t.string "event_fields_json"
t.index ["db_folder_id"], name: "index_event_streams_on_db_folder_id" t.index ["db_folder_id"], name: "index_event_streams_on_db_folder_id"
...@@ -142,17 +141,17 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -142,17 +141,17 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.integer "user_id" t.integer "user_id"
t.integer "data_app_id" t.integer "data_app_id"
t.string "value" t.string "value"
t.datetime "expiration" t.datetime "expiration", precision: nil
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.index ["data_app_id"], name: "index_interface_auth_tokens_on_data_app_id" t.index ["data_app_id"], name: "index_interface_auth_tokens_on_data_app_id"
t.index ["user_id"], name: "index_interface_auth_tokens_on_user_id" t.index ["user_id"], name: "index_interface_auth_tokens_on_user_id"
end end
create_table "interface_permissions", force: :cascade do |t| create_table "interface_permissions", force: :cascade do |t|
t.integer "interface_id" t.integer "interface_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.integer "user_id" t.integer "user_id"
t.integer "user_group_id" t.integer "user_group_id"
t.string "role" t.string "role"
...@@ -170,24 +169,24 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -170,24 +169,24 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
create_table "nilm_auth_keys", force: :cascade do |t| create_table "nilm_auth_keys", force: :cascade do |t|
t.integer "user_id" t.integer "user_id"
t.string "key" t.string "key"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
end end
create_table "nilms", force: :cascade do |t| create_table "nilms", force: :cascade do |t|
t.string "name" t.string "name"
t.string "description" t.string "description"
t.string "url" t.string "url"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.string "node_type" t.string "node_type"
t.string "key" t.string "key"
end end
create_table "permissions", force: :cascade do |t| create_table "permissions", force: :cascade do |t|
t.integer "nilm_id" t.integer "nilm_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.integer "user_id" t.integer "user_id"
t.integer "user_group_id" t.integer "user_group_id"
t.string "role" t.string "role"
...@@ -197,8 +196,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -197,8 +196,8 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.string "name" t.string "name"
t.string "description" t.string "description"
t.integer "owner_id" t.integer "owner_id"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
end end
create_table "users", force: :cascade do |t| create_table "users", force: :cascade do |t|
...@@ -206,27 +205,27 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do ...@@ -206,27 +205,27 @@ ActiveRecord::Schema.define(version: 2023_06_19_132452) do
t.string "uid", default: "", null: false t.string "uid", default: "", null: false
t.string "encrypted_password", default: "" t.string "encrypted_password", default: ""
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at" t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0, null: false t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at" t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at" t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip" t.string "current_sign_in_ip"
t.string "last_sign_in_ip" t.string "last_sign_in_ip"
t.string "confirmation_token" t.string "confirmation_token"
t.datetime "confirmed_at" t.datetime "confirmed_at", precision: nil
t.datetime "confirmation_sent_at" t.datetime "confirmation_sent_at", precision: nil
t.string "unconfirmed_email" t.string "unconfirmed_email"
t.string "first_name" t.string "first_name"
t.string "last_name" t.string "last_name"
t.string "email" t.string "email"
t.text "tokens" t.text "tokens"
t.datetime "created_at", null: false t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", null: false t.datetime "updated_at", precision: nil, null: false
t.string "invitation_token" t.string "invitation_token"
t.datetime "invitation_created_at" t.datetime "invitation_created_at", precision: nil
t.datetime "invitation_sent_at" t.datetime "invitation_sent_at", precision: nil
t.datetime "invitation_accepted_at" t.datetime "invitation_accepted_at", precision: nil
t.integer "invitation_limit" t.integer "invitation_limit"
t.integer "invited_by_id" t.integer "invited_by_id"
t.string "invited_by_type" t.string "invited_by_type"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment