Better assert difference?

Rails come with some awesome assertion methods for writing tests: assert_difference(“User.count”, +1) do create_a_user end That asserts that the count of user was incremented by one. The plus sign is not needed, that’s just an integer, I add it to...

Redirect to SSL in Rails applications

I’ve looked at the various ssl_requirement repositories out there. I concluded the most modern and maintained version is yardstick’s which is released as a gem called sslrequirement, but I’ve failed to use it properly. So I just did it by hand....

Really resetting the database

When I start coding a Ruby on Rails project, I find myself modifying the migration files over and over. I know this is not the way they were intended to use, but to avoid upfront design, I only ad fields when I need them. If I respected the way migrations were...

My Profile page: a RESTful single resource using Formtastic

I’ve just implemented the My Profile tab for Sano: Can I write 500 words about? Well, I can try. I like using RESTful routes. In case you don’t know what they are let me try to explain it quick, at least the relevant part. You normally have a set of route...

I love to code

I said I was done for the day more than 6 hours ago, but I love to code, I couldn’t stop. I wanted to implement a small feature: make the creation of new weights simpler for the common case and I did it: Note: That change is not yet deployed. I don’t play...