diff --git a/Gemfile b/Gemfile index ea16c3025..d4b314b98 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } gemspec -gem 'rails', '~> 6.1.4' group :development do gem 'letter_opener' diff --git a/Gemfile.lock b/Gemfile.lock index 5fe806481..8f926f8f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,65 +24,65 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + actioncable (7.0.0) + actionpack (= 7.0.0) + activesupport (= 7.0.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionmailbox (7.0.0) + actionpack (= 7.0.0) + activejob (= 7.0.0) + activerecord (= 7.0.0) + activestorage (= 7.0.0) + activesupport (= 7.0.0) mail (>= 2.7.1) - actionmailer (6.1.4.4) - actionpack (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionmailer (7.0.0) + actionpack (= 7.0.0) + actionview (= 7.0.0) + activejob (= 7.0.0) + activesupport (= 7.0.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.4.4) - actionview (= 6.1.4.4) - activesupport (= 6.1.4.4) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.0) + actionview (= 7.0.0) + activesupport (= 7.0.0) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.4.4) - actionpack (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actiontext (7.0.0) + actionpack (= 7.0.0) + activerecord (= 7.0.0) + activestorage (= 7.0.0) + activesupport (= 7.0.0) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.4.4) - activesupport (= 6.1.4.4) + actionview (7.0.0) + activesupport (= 7.0.0) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.4.4) - activesupport (= 6.1.4.4) + activejob (7.0.0) + activesupport (= 7.0.0) globalid (>= 0.3.6) - activemodel (6.1.4.4) - activesupport (= 6.1.4.4) - activerecord (6.1.4.4) - activemodel (= 6.1.4.4) - activesupport (= 6.1.4.4) - activestorage (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activesupport (= 6.1.4.4) - marcel (~> 1.0.0) + activemodel (7.0.0) + activesupport (= 7.0.0) + activerecord (7.0.0) + activemodel (= 7.0.0) + activesupport (= 7.0.0) + activestorage (7.0.0) + actionpack (= 7.0.0) + activejob (= 7.0.0) + activerecord (= 7.0.0) + activesupport (= 7.0.0) + marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.4.4) + activesupport (7.0.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ancestry (4.1.0) @@ -184,21 +184,20 @@ GEM rack-rewrite (1.5.1) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.1.4.4) - actioncable (= 6.1.4.4) - actionmailbox (= 6.1.4.4) - actionmailer (= 6.1.4.4) - actionpack (= 6.1.4.4) - actiontext (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activemodel (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + rails (7.0.0) + actioncable (= 7.0.0) + actionmailbox (= 7.0.0) + actionmailer (= 7.0.0) + actionpack (= 7.0.0) + actiontext (= 7.0.0) + actionview (= 7.0.0) + activejob (= 7.0.0) + activemodel (= 7.0.0) + activerecord (= 7.0.0) + activestorage (= 7.0.0) + activesupport (= 7.0.0) bundler (>= 1.15.0) - railties (= 6.1.4.4) - sprockets-rails (>= 2.0.0) + railties (= 7.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -208,12 +207,13 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + railties (7.0.0) + actionpack (= 7.0.0) + activesupport (= 7.0.0) method_source - rake (>= 0.13) + rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rake (13.0.6) regexp_parser (2.2.0) request_store (1.5.0) @@ -273,7 +273,6 @@ DEPENDENCIES mocha pry-rails puma - rails (~> 6.1.4) rails-controller-testing selenium-webdriver (~> 4.1.0) simplecov diff --git a/app/controllers/spina/admin/images_controller.rb b/app/controllers/spina/admin/images_controller.rb index 64776c96a..6a72bca1d 100644 --- a/app/controllers/spina/admin/images_controller.rb +++ b/app/controllers/spina/admin/images_controller.rb @@ -23,6 +23,8 @@ def edit # 2. We destroy the entire record if the uploaded file is not an image def create @images = params[:image][:files].map do |file| + next if file.blank? # Skip the blank string posted by the hidden files[] field + # Create the image and attach the file image = Image.create(media_folder_id: image_params[:media_folder_id]) image.file.attach(file) diff --git a/app/models/spina/parts/image.rb b/app/models/spina/parts/image.rb index 5e2b57da7..823e186c3 100644 --- a/app/models/spina/parts/image.rb +++ b/app/models/spina/parts/image.rb @@ -28,7 +28,7 @@ def present? signed_blob_id.present? end - def signed_id + def signed_id(expires_in: nil) signed_blob_id end diff --git a/lib/spina/engine.rb b/lib/spina/engine.rb index 9cbf4ed57..048d05d21 100644 --- a/lib/spina/engine.rb +++ b/lib/spina/engine.rb @@ -11,6 +11,7 @@ require 'view_component' require 'jsonapi/serializer' require 'browser' +require 'sprockets/railtie' module Spina class Engine < ::Rails::Engine diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 0fcc27af8..d2bdd3385 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -8,7 +8,7 @@ module Dummy class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.0 + config.load_defaults 7.0 config.hosts << "dummy.puma" config.hosts << "dummy.test" diff --git a/test/dummy/config/initializers/new_framework_defaults_6_1.rb b/test/dummy/config/initializers/new_framework_defaults_6_1.rb deleted file mode 100644 index c058ada7f..000000000 --- a/test/dummy/config/initializers/new_framework_defaults_6_1.rb +++ /dev/null @@ -1,27 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 6.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. - -# Support for inversing belongs_to -> has_many Active Record associations. -# Rails.application.config.active_record.has_many_inversing = true - -# Track Active Storage variants in the database. -# Rails.application.config.active_storage.track_variants = true - -# Stop executing `after_enqueue`/`after_perform` callbacks if -# `before_enqueue`/`before_perform` respectively halts with `throw :abort`. -# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true - -# Specify cookies SameSite protection level: either :none, :lax, or :strict. -# -# This change is not backwards compatible with earlier Rails versions. -# It's best enabled when your entire app is migrated and stable on 6.1. -# Rails.application.config.action_dispatch.cookies_same_site_protection = :lax - -# Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an -# UTC offset or a UTC time. -# ActiveSupport.utc_to_local_returns_utc_offset_times = true