diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 0ac8e39bd7..29d4116d6f 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -106,6 +106,18 @@ jobs: database: postgresql storage: active_storage experimental: true + - rails: "8.1" + ruby: "3.4" + database: postgresql + storage: active_storage + - rails: "8.1" + ruby: "3.4" + database: mariadb + storage: dragonfly + - rails: "8.1" + ruby: "3.4" + database: sqlite + storage: active_storage continue-on-error: ${{ matrix.experimental == true }} env: diff --git a/Gemfile b/Gemfile index 551ae9426a..ee70533974 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" gemspec -rails_version = ENV.fetch("RAILS_VERSION", "8.0") +rails_version = ENV.fetch("RAILS_VERSION", "8.1") gem "rails", "~> #{rails_version}.0" if ENV["DB"].nil? || ENV["DB"] == "sqlite" diff --git a/alchemy_cms.gemspec b/alchemy_cms.gemspec index 7d0b9a1d70..e90b85284a 100644 --- a/alchemy_cms.gemspec +++ b/alchemy_cms.gemspec @@ -34,12 +34,12 @@ Gem::Specification.new do |gem| activesupport railties ].each do |rails_gem| - gem.add_runtime_dependency rails_gem, [">= 7.1", "< 8.1"] + gem.add_runtime_dependency rails_gem, [">= 7.1", "< 8.2"] end gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.14"] gem.add_runtime_dependency "acts_as_list", [">= 0.3", "< 2"] - gem.add_runtime_dependency "awesome_nested_set", ["~> 3.1", ">= 3.7.0"] + gem.add_runtime_dependency "awesome_nested_set", [">= 3.9.0", "< 4.0"] gem.add_runtime_dependency "cancancan", [">= 2.1", "< 4.0"] gem.add_runtime_dependency "csv", ["~> 3.3"] gem.add_runtime_dependency "dragonfly", ["~> 1.4"] diff --git a/app/models/alchemy/element_definition.rb b/app/models/alchemy/element_definition.rb index 219adc3ae8..9bf98221e1 100644 --- a/app/models/alchemy/element_definition.rb +++ b/app/models/alchemy/element_definition.rb @@ -4,7 +4,6 @@ module Alchemy class ElementDefinition include ActiveModel::Model include ActiveModel::Attributes - include Alchemy::Hints extend ActiveModel::Translation @@ -23,6 +22,10 @@ class ElementDefinition attribute :hint attribute :icon + # Needs to be down here in order to have the attribute reader + # available after the attribute is defined. + include Alchemy::Hints + validates :name, presence: true, format: { diff --git a/app/models/alchemy/ingredient_definition.rb b/app/models/alchemy/ingredient_definition.rb index aff0f80ff9..abcced4008 100644 --- a/app/models/alchemy/ingredient_definition.rb +++ b/app/models/alchemy/ingredient_definition.rb @@ -4,7 +4,6 @@ module Alchemy class IngredientDefinition include ActiveModel::Model include ActiveModel::Attributes - include Alchemy::Hints extend ActiveModel::Translation @@ -18,6 +17,10 @@ class IngredientDefinition attribute :deprecated attribute :hint + # Needs to be down here in order to have the attribute reader + # available after the attribute is defined. + include Alchemy::Hints + validates :role, presence: true, format: { diff --git a/app/models/alchemy/page_definition.rb b/app/models/alchemy/page_definition.rb index cdbdde0d15..b979bbe059 100644 --- a/app/models/alchemy/page_definition.rb +++ b/app/models/alchemy/page_definition.rb @@ -4,7 +4,6 @@ module Alchemy class PageDefinition include ActiveModel::Model include ActiveModel::Attributes - include Alchemy::Hints extend ActiveModel::Translation @@ -22,6 +21,10 @@ class PageDefinition attribute :editable_by attribute :hint + # Needs to be down here in order to have the attribute reader + # available after the attribute is defined. + include Alchemy::Hints + validates :name, presence: true, format: { diff --git a/config/routes.rb b/config/routes.rb index 66c7b92063..110dd2db0a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ get "/sitemap.xml", to: "pages#sitemap", format: "xml" - scope Alchemy.admin_path, {constraints: Alchemy.admin_constraints} do + scope Alchemy.admin_path, constraints: Alchemy.admin_constraints do get "/", to: redirect("#{Alchemy.admin_path}/dashboard"), as: :admin get "/dashboard", to: "admin/dashboard#index", as: :admin_dashboard get "/dashboard/info", to: "admin/dashboard#info", as: :dashboard_info @@ -16,7 +16,7 @@ get "/leave", to: "admin/base#leave", as: :leave_admin end - namespace :admin, {path: Alchemy.admin_path, constraints: Alchemy.admin_constraints} do + namespace :admin, path: Alchemy.admin_path, constraints: Alchemy.admin_constraints do resources :nodes resources :pages do diff --git a/spec/dummy/app/assets/stylesheets/alchemy/elements/_index.scss b/spec/dummy/app/assets/stylesheets/alchemy/elements/_index.scss index 0fd20e62e2..c6a5ca7f6e 100644 --- a/spec/dummy/app/assets/stylesheets/alchemy/elements/_index.scss +++ b/spec/dummy/app/assets/stylesheets/alchemy/elements/_index.scss @@ -1,4 +1,4 @@ -@import "all_you_can_eat"; -@import "gallery"; -@import "header"; -@import "slider"; +@use "all_you_can_eat"; +@use "gallery"; +@use "header"; +@use "slider"; diff --git a/spec/dummy/app/assets/stylesheets/application.scss b/spec/dummy/app/assets/stylesheets/application.scss index 15dcfcce5a..a19dfa3db3 100644 --- a/spec/dummy/app/assets/stylesheets/application.scss +++ b/spec/dummy/app/assets/stylesheets/application.scss @@ -1,4 +1,4 @@ -@import "alchemy/elements"; +@use "alchemy/elements"; body { background-color: #f9f9f9;