Skip to content

Commit c1f9570

Browse files
committed
Fix resource name for namespaced models in mailer helper
1 parent d8ea28d commit c1f9570

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/helpers/graphql_devise/mailer_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module GraphqlDevise
22
module MailerHelper
33
def confirmation_query(resource_name:, token:, redirect_url:)
4-
name = "#{resource_name.camelize(:lower)}ConfirmAccount"
4+
name = "#{resource_name.underscore.tr('/', '_').camelize(:lower)}ConfirmAccount"
55
raw = <<-GRAPHQL
66
query($token:String!,$redirectUrl:String!){
77
#{name}(confirmationToken:$token,redirectUrl:$redirectUrl){
@@ -17,7 +17,7 @@ def confirmation_query(resource_name:, token:, redirect_url:)
1717
end
1818

1919
def password_reset_query(token:, redirect_url:, resource_name:)
20-
name = "#{resource_name.camelize(:lower)}CheckPasswordToken"
20+
name = "#{resource_name.underscore.tr('/', '_').camelize(:lower)}CheckPasswordToken"
2121
raw = <<-GRAPHQL
2222
query($token:String!,$redirectUrl:String!){
2323
#{name}(resetPasswordToken:$token,redirectUrl:$redirectUrl){

0 commit comments

Comments
 (0)