Skip to content

Commit

Permalink
don't configure authentication_method if devise isn't used (fix #3467)
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschilling committed Oct 19, 2014
1 parent 483661d commit c64176d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/generators/active_admin/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class InstallGenerator < ActiveRecord::Generators::Base

def copy_initializer
@underscored_user_name = name.underscore
@use_authentication_method = options[:users].present?
template 'active_admin.rb.erb', 'config/initializers/active_admin.rb'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ActiveAdmin.setup do |config|
#
# This setting changes the method which Active Admin calls
# within the application controller.
config.authentication_method = :authenticate_<%= @underscored_user_name %>!
<% unless @use_authentication_method %># <% end %>config.authentication_method = :authenticate_<%= @underscored_user_name %>!

# == User Authorization
#
Expand Down

0 comments on commit c64176d

Please sign in to comment.