Skip to content

Commit 1fc5a2b

Browse files
authored
Merge pull request #225 from AlchemyCMS/alchemy-8
Add support for Alchemy 8.0
2 parents c6e57ce + 6a6617c commit 1fc5a2b

19 files changed

Lines changed: 214 additions & 257 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,17 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
alchemy_branch:
12-
- "7.1-stable"
13-
- "7.2-stable"
14-
- "7.3-stable"
15-
- "7.4-stable"
12+
- "main"
1613
ruby:
1714
- "3.2"
1815
- "3.3"
1916
- "3.4"
2017
rails:
21-
- "7.1"
2218
- "7.2"
2319
database:
2420
- mysql
2521
- postgresql
2622
- sqlite
27-
exclude:
28-
- alchemy_branch: "7.1-stable"
29-
rails: "7.2"
30-
- alchemy_branch: "7.2-stable"
31-
rails: "7.2"
32-
- alchemy_branch: "7.1-stable"
33-
ruby: "3.4"
34-
- alchemy_branch: "7.2-stable"
35-
ruby: "3.4"
36-
- rails: "7.1"
37-
ruby: "3.4"
3823

3924
env:
4025
DB: ${{ matrix.database }}
@@ -107,8 +92,6 @@ jobs:
10792

10893
Lint:
10994
runs-on: ubuntu-22.04
110-
env:
111-
ALCHEMY_BRANCH: 7.3-stable
11295
steps:
11396
- name: Checkout code
11497
uses: actions/checkout@v4

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
alchemy_branch = ENV.fetch("ALCHEMY_BRANCH", "7.4-stable")
3+
alchemy_branch = ENV.fetch("ALCHEMY_BRANCH", "main")
44
gem "alchemy_cms", github: "AlchemyCMS/alchemy_cms", branch: alchemy_branch
55

66
rails_version = ENV.fetch("RAILS_VERSION", "7.2")
@@ -22,3 +22,5 @@ end
2222
gem "github_fast_changelog", require: false
2323

2424
gem "standardrb", "~> 1.0", require: false
25+
26+
gem "propshaft", "~> 1.1"

alchemy-devise.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
1515

1616
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "CHANGELOG.md", "README.md"]
1717

18-
s.add_dependency "alchemy_cms", ["~> 7.0"]
18+
s.add_dependency "alchemy_cms", [">= 8.0.0.a", "< 9.0"]
1919
s.add_dependency "devise", ["~> 4.9"]
2020

2121
s.add_development_dependency "capybara"

app/mailers/alchemy/notifications.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Alchemy
22
class Notifications < ActionMailer::Base
3-
default(from: Config.get(:mailer)["mail_from"])
3+
default(from: Alchemy.config.get(:mailer)["mail_from"])
44

55
def member_created(user)
66
@user = user

app/models/alchemy/user.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class User < ActiveRecord::Base
3535
scope :logged_in, -> { where("last_request_at > ?", logged_in_timeout.seconds.ago) }
3636
scope :logged_out, -> { where("last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago) }
3737

38-
ROLES = Config.get(:user_roles)
38+
ROLES = Alchemy.config.user_roles
3939

4040
class << self
4141
def ransackable_attributes(_auth_object = nil)
@@ -65,7 +65,7 @@ def human_rolename(role)
6565
end
6666

6767
def logged_in_timeout
68-
Config.get(:auto_logout_time).minutes.to_i
68+
Alchemy.config.get(:auto_logout_time).minutes.to_i
6969
end
7070
end
7171

app/views/alchemy/admin/users/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<% end %>
44

55
<%= content_for :toolbar do %>
6-
<%= toolbar_button(
6+
<%= render Alchemy::Admin::ToolbarButton.new(
77
icon: :plus,
88
label: Alchemy.t(:create_user),
99
url: alchemy.new_admin_user_path,

config/initializers/alchemy.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
Rails.application.config.to_prepare do
44
require "alchemy/devise/ability"
55

6-
alchemy_7_4 = Gem::Version.new("7.4.0.a")
7-
8-
icon = if Alchemy.gem_version.between? Gem::Version.new("7.1.0-b1"), alchemy_7_4
9-
"group-line"
10-
elsif Alchemy.gem_version > alchemy_7_4
11-
"group"
12-
else
13-
"users"
14-
end
15-
166
Alchemy.register_ability(Alchemy::Devise::Ability)
177

188
Alchemy::Modules.register_module({
@@ -23,7 +13,7 @@
2313
name: "modules.users",
2414
controller: "/alchemy/admin/users",
2515
action: "index",
26-
icon: icon
16+
icon: "group"
2717
}
2818
})
2919

lib/alchemy/devise/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Alchemy
22
module Devise
3-
VERSION = "7.4.1"
3+
VERSION = "8.0.0.a"
44
end
55
end

lib/generators/alchemy/devise/install/templates/devise.rb.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Devise.setup do |config|
2424
# Configure the e-mail address which will be shown in Devise::Mailer,
2525
# note that it will be overwritten if you use your own mailer class
2626
# with default "from" parameter.
27-
config.mailer_sender = Alchemy::Config.get(:mailer)['mail_from']
27+
config.mailer_sender = Alchemy.config.mailer.mail_from
2828

2929
# Configure the class responsible to send e-mails.
3030
config.mailer = "Alchemy::Notifications"
@@ -188,7 +188,7 @@ Devise.setup do |config|
188188
# ==> Configuration for :timeoutable
189189
# The time you want to timeout the user session without activity. After this
190190
# time the user will be asked for credentials again. Default is 30 minutes.
191-
config.timeout_in = Rails.env.development? ? nil : Alchemy::Config.get(:auto_logout_time).minutes
191+
config.timeout_in = Rails.env.development? ? nil : Alchemy.config.auto_logout_time.minutes
192192

193193
# ==> Configuration for :lockable
194194
# Defines which strategy will be used to lock an account.

spec/dummy/app/assets/builds/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)