Ruby gotcha: string comparison is case sensitive
Here is a Ruby gotcha: String comparison is case sensitive. (more…)
Rails Single Table Inheritance Helper Module
Single table inheritance is a somewhat controversial topic in Rails land. For me, I like the Rails magic that it brings and, you know, the inheritance. However, it can clearly be abused. Here is my one rule for using Single table inheritance: (more…)
The Power of JRuby
I hesitated about using JRuby at first. I spend days beefing up on Java, which I hadn't used in years. Even though I had been using Ruby on Rails for about a year, I felt more intimidated by JRuby than going back to Java. To be fair, the project I was working on involved integrating with complicated, legacy code. I started from a place of FUD. It took me fighting with Spring MVC to get it to return JSON without a view to say "Fuck it" ...
Stubbing Backbone.js fetch with Jasmine & Sinon.js
I needed to stub out a Backbone collection's fetch method and make it return success. I'm using Jasmine BDD for the testing framework and Sinon.js for stubbing the methods. Here's how I did it: (more…)