-
Archives
-
Meta
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
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