Category Archives: Rails

Better Rails Searching with Named Scopes using Scope Builder

When it comes writing elegant search code in a Rails app, Named Scopes immediately come to mind.  And for good reason: they’re a fantastic way to express, well, scopes, for your searches.  In your Person model, you might have named … Continue reading

Share
Posted in Rails | Tagged , , | Leave a comment

Quick and Dirty Messaging

Our Rails Rumble 2008 entry, Great Minds (you can have a look at the latest version or the original Rumble version), required a messaging system. Such systems are easy to do wrong, and we knew we’d need something that would … Continue reading

Share
Posted in Great Minds, Javascript, Programming, Rails | Tagged , , , , , , , , , , | 3 Comments

Don’t try to be smarter than ActiveRecord

When you’re writing conditions for a finder in ActiveRecord, and you want to use an array of values for a sql in() statement, you might think to help ActiveRecord out and comma-separate the array values like this: type_ids = [1, … Continue reading

Share
Posted in Rails | Tagged , , , , | Comments Off