Skip to content

Commit c14fc1d

Browse files
committed
Fix the standard generator alias
This generator is here for anyone trying to run th standard `bin/rails g solidus_auth_devise:install`. Turns out that assigning to another constant is not enough and we need to proxy it more explicitly.
1 parent 63cc6ca commit c14fc1d

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# frozen_string_literal: true
22

33
require_relative '../../solidus/auth/install/install_generator'
4+
45
module SolidusAuthDevise
56
module Generators
6-
InstallGenerator = ::Solidus::Auth::Generators::InstallGenerator
7+
class InstallGenerator < Rails::Generators::Base
8+
# Copy over any class option from the legacy install generator
9+
Solidus::Auth::Generators::InstallGenerator.class_options.each do |name, option|
10+
class_options[name] ||= option.dup
11+
end
12+
13+
def forward_to_spree_auth_install
14+
generate 'solidus:auth:install', *ARGV
15+
end
16+
end
717
end
818
end

lib/solidus_auth_devise/engine.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
# frozen_string_literal: true
22

33
require 'spree/auth/engine'
4-
5-
module SolidusAuthDevise
6-
Engine = ::Spree::Auth::Engine
7-
end

lib/spree/auth/engine.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,5 @@ def self.prepare_frontend
9595
end
9696
end
9797
end
98+
99+
SolidusAuthDevise::Engine = Spree::Auth::Engine

0 commit comments

Comments
 (0)