mercredi 9 septembre 2020

uninitialize constant user (work with dto)

I'm learning rails using Devise for authentication purpose and make a User by Rails generate Devise user it creates a user model for me & every thing is works fine But when i put my file to User component
Component

where I have user_dto & user_service file as well.

problem occur when I try to create a migration by rails g migration add_authentication_token_to_users "authentication_token:string{30}:uniq" and i got an error here **uninitialized constant User (NameError) ** error is resolved when i put back user.rb file to models but i have to work in this way , is their any solution to generate a migration with putting this user.rb file to component not in model.

Aucun commentaire:

Enregistrer un commentaire