#ruby

We rebuilt our site to be faster, future-proof, and fun to work on.
The following technique requires high test coverage. Where does the default_scope get used? We can print a stack trace whenever the default_scope is used.
A post to the Ruby on Rails security list yesterday revealed a pretty serious vulnerability in ActionController's handling of implicit controller actions. (You know, when a controller doesn't have a certain method defined but it's successfully...
TL;DR: Add our utf8-cleaner Ruby gem to your Rails app and kiss request encoding errors goodbye! Our Rails apps send us error reports by email every time a request results in a 500 error. Sometimes these are legitimate bugs, and we can roll...
Now that we've got a few full-time remote workers, we're really interested in making sure that they feel like part of the team. Telepresence really helps with that, and one great, free telepresence tool is Google+ Hangouts. We...
Read this gist on github.
Because I switch between ColdFusion and Ruby on a weekly basis, when I work on ColdFusion I sometimes miss some of the features that I have in Ruby. Like having a hash return a nil when a key doesn't exist, rather than getting an error when a key...
Don't just disable SSL, install the intermediate certificates from the Certificate Authority (CA).
Last month, several Singlebrook developers participated in Ithaca’s Global Day of Code Retreat. The event had a very simple structure; the day was broken into several 45 minute pair-programming sessions - switching partners...
Here's a nice ruby 1.9 discovery to brighten your day. In 1.8 we had to: - require File.expand_path('../relative/path', __FILE__) - but in 1.9 you can: - relative_require 'relative/path'...
If you're using a CDN to serve your static assets, your webfonts may break if you don't provide the correct CORS headers. Update: be sure to turn...
Out of the box, rspec likes to dump all of the specs to stdout: - $ rake spec - ruby -S rspec ./spec/controllers/activity_categories_controller_spec.rb ./spec/controllers/attendee_controller_activities_spec.rb...
I was quite confused when I saw lines like this in controllers that I was working on: - Sign in user? Is it that easy? Do I just type what I want in plain text and the computer will know what I’m talking about? Well, no, of course not...but as someone new to the system, these sorts of conventions can be really confusing. If you find yourself in this position, then you are probably coming from another language where class inheritance worked differently from Ruby.  -
Last night I wrote this fun code to see if I could display a Mandelbrot fractal in my terminal. It was easier than I thought, thanks to some pseudo-code on the Mandelbrot Set Wikipedia page, although tracking down the proper...
As of today, I am no longer a Singlebrooker.  - I am voluntarily walking away from the best job I have had to spend time not programming and not in front of a computer screen. It will be an adventure, but before I leave, I feel...
I walked up to the door, not quite knowing what to expect. I had rushed over there from my co-working space to participate in the RailsBridge Friday night install-fest. I buzzed and was let in. RailsBridge started a few years ago in the wake of a...
During our Saturday Open Source Hackathon, I was working on trying to fix a bug in Rails' update_all() method. Following the Contributing to Rails guide, I got set up to run ActiveRecord's tests on all of the major databases used with Rails. When...