-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move initializer code into to_prepare block
Rails 7 does not autoload constants during boot anymore.
- Loading branch information
Showing
1 changed file
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
Alchemy.register_ability Ability | ||
Alchemy.user_class_name = 'DummyUser' | ||
Alchemy.signup_path = '/admin/pages' unless Rails.env.test? | ||
Alchemy::Modules.register_module( | ||
name: 'events', | ||
navigation: { | ||
name: 'Events', | ||
controller: '/admin/events', | ||
action: 'index', | ||
icon: 'calendar-alt', | ||
sub_navigation: [{ | ||
name: 'Events', | ||
controller: '/admin/events', | ||
action: 'index' | ||
}, { | ||
name: 'Locations', | ||
controller: '/admin/locations', | ||
action: 'index' | ||
}, { | ||
name: 'Series', | ||
controller: '/admin/series', | ||
action: 'index' | ||
}, { | ||
name: 'Bookings', | ||
controller: '/admin/bookings', | ||
action: 'index' | ||
}] | ||
} | ||
) | ||
Rails.application.config.to_prepare do | ||
Alchemy.register_ability Ability | ||
Alchemy.user_class_name = "DummyUser" | ||
Alchemy.signup_path = "/admin/pages" unless Rails.env.test? | ||
Alchemy::Modules.register_module( | ||
name: "events", | ||
navigation: { | ||
name: "Events", | ||
controller: "/admin/events", | ||
action: "index", | ||
icon: "calendar-alt", | ||
sub_navigation: [{ | ||
name: "Events", | ||
controller: "/admin/events", | ||
action: "index", | ||
}, { | ||
name: "Locations", | ||
controller: "/admin/locations", | ||
action: "index", | ||
}, { | ||
name: "Series", | ||
controller: "/admin/series", | ||
action: "index", | ||
}, { | ||
name: "Bookings", | ||
controller: "/admin/bookings", | ||
action: "index", | ||
}], | ||
}, | ||
) | ||
end |