Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Rails 6.1.7.6 > 7.0.8 #722

Merged
merged 11 commits into from
Oct 20, 2023
128 changes: 67 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,67 +35,73 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.2)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
mail (>= 2.7.1)
actionmailer (6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activesupport (= 6.1.7.6)
net-imap
net-pop
net-smtp
actionmailer (7.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.7.6)
actionview (= 6.1.7.6)
activesupport (= 6.1.7.6)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.7.6)
activesupport (= 6.1.7.6)
actionview (7.0.8)
activesupport (= 7.0.8)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.6)
activesupport (= 6.1.7.6)
activejob (7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.3.6)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activesupport (= 6.1.7.6)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activestorage-validator (0.3.0)
rails (>= 6.1.0)
activesupport (6.1.7.6)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
acts_as_list (1.1.0)
activerecord (>= 4.2)
acts_as_tree (2.9.1)
Expand Down Expand Up @@ -180,7 +186,7 @@ GEM
addressable (~> 2.8)
libv8-node (16.10.0.0-x86_64-darwin)
libv8-node (16.10.0.0-x86_64-linux)
loofah (2.21.3)
loofah (2.21.4)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -201,14 +207,14 @@ GEM
multi_xml (0.6.0)
multipart-post (2.2.3)
mysql2 (0.5.5)
net-imap (0.3.7)
net-imap (0.4.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.4-x86_64-darwin)
Expand Down Expand Up @@ -236,21 +242,20 @@ GEM
rack-test (2.1.0)
rack (>= 1.3)
radius (0.7.5)
rails (6.1.7.6)
actioncable (= 6.1.7.6)
actionmailbox (= 6.1.7.6)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actiontext (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
bundler (>= 1.15.0)
railties (= 6.1.7.6)
sprockets-rails (>= 2.0.0)
railties (= 7.0.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -260,12 +265,13 @@ GEM
nokogiri (~> 1.14)
rails-observers (0.1.5)
activemodel (>= 4.0)
railties (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
rdoc (6.5.0)
psych (>= 4.0.0)
Expand Down Expand Up @@ -344,7 +350,7 @@ GEM
will_paginate (4.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.11)
zeitwerk (2.6.12)

PLATFORMS
x86_64-darwin-18
Expand All @@ -371,4 +377,4 @@ DEPENDENCIES
trustygems (~> 0.2.0)

BUNDLED WITH
2.4.20
2.4.13
1 change: 0 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# require_dependency 'trusty_cms'
require 'login_system'

class ApplicationController < ActionController::Base
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/site_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'trusty_cms/pagination/controller'
require 'will_paginate/array'

class SiteController < ApplicationController
include TrustyCms::Pagination::Controller

Expand Down Expand Up @@ -42,16 +44,19 @@ def show_page
def cacheable_request?
(request.head? || request.get?) && live?
end

# hide_action :cacheable_request?

def set_expiry(time, options = {})
expires_in time, options
end

# hide_action :set_expiry

def set_etag(val)
headers['ETag'] = val
end

# hide_action :set_expiry

private
Expand Down
1 change: 1 addition & 0 deletions app/models/site.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The site class includes - in find_for_host - some key retrieval and creation logic that is called from ApplicationController to set the current site context.
# Otherwise it's just another Trusty data model.
require 'acts_as_list'

class Site < ActiveRecord::Base
acts_as_list
Expand Down
6 changes: 2 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('boot', __dir__)
require_relative 'boot'

require 'rails/all'
require 'acts_as_tree'
Expand All @@ -18,8 +18,6 @@ module TrustyCms
class Application < Rails::Application
include TrustyCms::Initializer
config.active_record.whitelist_attributes = true
config.autoload_paths += %W(#{config.root}/lib)
config.eager_load_paths << Rails.root.join('lib')

# Enable the asset pipeline
config.assets.enabled = true
Expand Down Expand Up @@ -80,7 +78,7 @@ class Application < Rails::Application
end
config.after_initialize do
extension_loader.load_extensions
extension_loader.load_extension_initalizers
extension_loader.load_extension_initializers

extension_loader.activate_extensions # also calls initialize_views
# config.add_controller_paths(extension_loader.paths(:controller))
Expand Down
25 changes: 12 additions & 13 deletions config/initializers/trusty_cms_config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'multi_site/engine'
require 'clipped/engine'
Rails.application.reloader.to_prepare do
TrustyCms.config do |config|
config.define 'admin.title', default: 'TrustyCms CMS'
Expand All @@ -22,18 +20,18 @@

TrustyCms.config do |config|
config.namespace 'paperclip' do |pc|
pc.define 'url', default: '/system/:attachment/:id/:style/:basename:no_original_style.:extension', allow_change: true
pc.define 'path', default: ':rails_root/public/system/:attachment/:id/:style/:basename:no_original_style.:extension', allow_change: true
pc.define 'url', default: '/system/:attachment/:id/:style/:basename:no_original_style.:extension', allow_change: true
pc.define 'path', default: ':rails_root/public/system/:attachment/:id/:style/:basename:no_original_style.:extension', allow_change: true
pc.define 'skip_filetype_validation', default: true, type: :boolean
pc.define 'storage', default: 'filesystem',
select_from: {
'File System' => 'filesystem',
'Amazon S3' => 'fog',
'Google Storage' => 'fog',
'Rackspace Cloud Files' => 'fog',
},
allow_blank: false,
allow_display: false
select_from: {
'File System' => 'filesystem',
'Amazon S3' => 'fog',
'Google Storage' => 'fog',
'Rackspace Cloud Files' => 'fog',
},
allow_blank: false,
allow_display: false

pc.namespace 'fog' do |fog|
fog.define 'provider', select_from: {
Expand Down Expand Up @@ -74,7 +72,8 @@
assets.define 'create_video_thumbnails?', default: 'true'
assets.define 'create_pdf_thumbnails?', default: 'true'

assets.namespace 'thumbnails' do |thumbs| # NB :icon and :thumbnail are already defined as fixed formats for use in the admin interface and can't be changed
assets.namespace 'thumbnails' do |thumbs|
# NB :icon and :thumbnail are already defined as fixed formats for use in the admin interface and can't be changed
thumbs.define 'image', default: 'normal:size=640x640>|small:size=320x320>'
thumbs.define 'video', default: 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
thumbs.define 'pdf', default: 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
Expand Down
19 changes: 10 additions & 9 deletions lib/configuration_extensions/configuration_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class << self
# config['other.thing'] = 'nothing'
# end
#
def config # method must be defined before any initializers run
def config # method must be defined before any initializers run
yield TrustyCms::Config if block_given?
TrustyCms::Config
end
Expand All @@ -33,6 +33,7 @@ def configuration
def root
Pathname.new(TRUSTY_CMS_ROOT) if defined?(TRUSTY_CMS_ROOT)
end

def boot!
unless booted?
preinitialize
Expand All @@ -46,12 +47,12 @@ def booted?

def pick_boot
case
when app?
AppBoot.new
when vendor?
VendorBoot.new
else
GemBoot.new
when app?
AppBoot.new
when vendor?
VendorBoot.new
else
GemBoot.new
end
end

Expand All @@ -77,7 +78,6 @@ def preinitializer_path
end
end


class Rails::Application::Configuration

# The TrustyCms::Configuration class extends Rails::Configuration with three purposes:
Expand Down Expand Up @@ -132,7 +132,8 @@ def expanded_extension_list
@extension_list ||= extensions ? expand_and_check(extensions) : available_extensions
end

def expand_and_check(extension_list) #:nodoc
def expand_and_check(extension_list)
#:nodoc
missing_extensions = extension_list - [:all] - available_extensions
raise LoadError, "These configured extensions have not been found: #{missing_extensions.to_sentence}" if missing_extensions.any?
if m = extension_list.index(:all)
Expand Down
1 change: 0 additions & 1 deletion lib/generators/extension/templates/extension.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Uncomment this if you reference any of your controllers in activate
# require_dependency "application_controller"
require "radiant-<%= file_name %>-extension"

class <%= class_name %> < TrustyCms::Extension
Expand Down
1 change: 0 additions & 1 deletion lib/generators/language_extension/templates/extension.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Uncomment this if you reference any of your controllers in activate
# require_dependency "application_controller"
require "radiant-<%= file_name %>_language_pack-extension"

class <%= class_name %> < TrustyCms::Extension
Expand Down
Loading
Loading