Honestly, I’ve run out of titles. Make up something on your own.
The pull request we made needed some major change we hadn’t thought of! Here’s explaining why :
Our feature was to make applicants form a team during the application process. We had a projects attribute belonging to a team model that should not be validated for presence when the user is an admin ( nah, the thread hash isn’t a good way to learn ) So, we had decided to make a different projects model itself and tweak the view to show this field to a team only and remove the projects attribute from a team model. Work done. But. But. But. Not yet. Monika brought to our notice that there are previous teams with projects attributes and when we run the migration to remove the projects attributes, the data would be lost! Oops. We definitely hadn’t thought of that. So, she suggested that we edit the migration file to make the transfer of the projects attribute values to a project model name attribute. Here again we faced some issues with the loop we were using. We asked for help on the lovely campfire and lucaspinto helped us out in the campfire! He figured that our loop statement Team.all do |team| *insert code to make transfer* wasn’t taking each team individually. The output was an entire list of teams and we definitely don’t want that! He suggested using Team.all.each do |team| *insert code to make transfer*. And wheeee! It was working! 😀
On a serious note, we really hope we could have figured out the stuff by ourselves. But these mistakes we make have opened up new ways of thinking about problems and issues. And now, we’re more confident of fixing stuff!
Here’s the link to our pull request – https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/121. Hoping for a review!