21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/generators/spree/custom_user/custom_user_generator.rb', line 21
def generate
migration_template 'migration.rb.tt', "db/migrate/add_spree_fields_to_custom_user_table.rb"
template 'authentication_helpers.rb.tt', "lib/spree/authentication_helpers.rb"
initializer 'solidus_authentication', <<~RUBY
Rails.application.config.to_prepare do
ApplicationController.include Spree::AuthenticationHelpers, Spree::CurrentUserHelpers
Spree::Api::BaseController.include Spree::CurrentUserHelpers if defined? Spree::Api
end
RUBY
gsub_file 'config/initializers/spree.rb', /Spree\.user_class.?=.?.+$/, %{Spree.user_class = "#{class_name}"}
end
|