Skip to content

Commit

Permalink
hard-coded User and namespaced model
Browse files Browse the repository at this point in the history
  • Loading branch information
ybian committed Nov 8, 2014
1 parent b2c0229 commit 56e7d55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create

begin
# override email confirmation, must be sent manually from ctrl
User.skip_callback("create", :after, :send_on_create_confirmation_instructions)
@resource.class.skip_callback("create", :after, :send_on_create_confirmation_instructions)
if @resource.save

unless @resource.confirmed?
Expand Down
5 changes: 3 additions & 2 deletions lib/devise_token_auth/rails/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ def mount_devise_token_auth_for(resource, opts)
opts[:skip].each{|item| controllers.delete(item)}

scope opts[:at] do
devise_for resource.pluralize.underscore.to_sym,
base_name = resource.split('::').last
devise_for base_name.pluralize.underscore.to_sym,
:class_name => resource,
:module => :devise,
:path => "",
:controllers => controllers

devise_scope resource.underscore.to_sym do
devise_scope base_name.underscore.to_sym do
# path to verify token validity
get "validate_token", to: "#{token_validations_ctrl}#validate_token"

Expand Down

0 comments on commit 56e7d55

Please sign in to comment.