Today was supposed to the final day for my first project using rails. I had implemented the post page, user authentication and markdown feature for the blog. I had one thing that I felt I needed to do, add a user edit feature. For this. for some reason, I chose to use the
devise gem. I thought it would be a good practice working with this gem. So far, I had been working with
bcrypt. Since,devise came with all the users related features, I thought about giving it a try.
I made a separate branch on my git repo so that I could work on this feature. At least I thought I had this process nailed down. Working on a different branch would make my working code safe. I did know that regardless of what branch I worked on the database would be shared. However, I decided to delete my users database, and start fresh with devise. This was a big, big error on my part.
I started building the entire user feature using devise. This was a straight forward approach I thought. But, then disaster struck, I started receiving all sort of errors. It was then, I realised, I should have created a separate database for my users and I could have named it anything else. However, my inability to come up with a database name meant that I dropped my working model. I now wanted to go back to using bcrypt, and at least my app would be working. I could then deploy it to heroku as planned.
Instead of adding a feature, I was, therefore, working to fix the howler I had made. In the end, though, I was able to fix it, and have the app working on heroku.
I will implement the app again using devise, but this time, with the experience that I can create a new model and not touch my working database.