Skip to content

Commit

Permalink
Use Flickwerk for patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mamhoff committed Jan 14, 2025
1 parent fa32b55 commit 4bafa9b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ group :test do
gem "pg", "~> 1.0" if ENV["DB"] == "postgresql"
end

gem "solidus_support", github: "mamhoff/solidus_support", branch: "re-enable-flickwerk"
gem "github_fast_changelog", require: false

gem "standardrb", "~> 1.0", require: false
18 changes: 0 additions & 18 deletions app/controllers/alchemy/base_controller_extension.rb

This file was deleted.

19 changes: 19 additions & 0 deletions app/patches/controllers/alchemy/devise/base_controller_patch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Alchemy
module Devise
module BaseControllerPatch
def self.prepended(base)
base.before_action(:store_user_request_time)
end

private

# Stores the users request time.
def store_user_request_time
if alchemy_user_signed_in?
current_alchemy_user.store_request_time!
end
end
Alchemy::BaseController.prepend self
end
end
end
8 changes: 2 additions & 6 deletions lib/alchemy/devise/engine.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
require "alchemy_cms"
require "devise"
require "flickwerk"

module Alchemy
module Devise
class Engine < ::Rails::Engine
include Flickwerk
isolate_namespace Alchemy
engine_name "alchemy_devise"

Expand All @@ -16,12 +18,6 @@ class Engine < ::Rails::Engine
"alchemy-devise.css"
]
end

config.to_prepare do
Rails.autoloaders.main.on_load("Alchemy::BaseController") do
Alchemy::BaseControllerExtension
end
end
end
end
end

0 comments on commit 4bafa9b

Please sign in to comment.