Permalink
Browse files

Creating a spree initializer for custom user class if no one is prese…

…nt in host app.

Fixes #1619
  • Loading branch information...
1 parent 569d38d commit 5b0a5ddb0d41ebcb74e1f1e9f50a84f55a350f67 Thomas von Deyen committed with radar Jun 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/lib/generators/spree/custom_user/custom_user_generator.rb
@@ -14,7 +14,8 @@ def generate
template 'migration.rb.tt', "db/migrate/#{Time.now.strftime("%Y%m%d%H%m%S")}_add_spree_fields_to_custom_user_table.rb"
template 'authentication_helpers.rb.tt', "lib/spree/authentication_helpers.rb"
- append_file 'config/initializers/spree.rb' do
+ file_action = File.exist?('config/initializers/spree.rb') ? :append_file : :create_file
+ send(file_action, 'config/initializers/spree.rb') do
%Q{require 'spree/authentication_helpers'\n}
end
end

0 comments on commit 5b0a5dd

Please sign in to comment.