Posted: November 22nd, 2008 | Author: Brad | Filed under: Great Minds, Javascript, Programming, Rails | Tags: gm, Great Minds, Javascript, message queue, messaging, Programming, Rails, rails rumble, ruby, ruby on rails, rumble | 1 Comment »
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 stay solid under unknown load during Rumble judging.
The solution was quick & dirty (as most solutions are during Rails Rumble), but the results worked, and allowed us to qualify for judging and reach a respectable 28th place finish in the “Completeness” category.
Check out the details after the fold.
Read the rest of this entry »
Posted: November 17th, 2008 | Author: gabe | Filed under: Rails | Tags: activerecord, mysql, sanitization, sql, sqlite | Comments Off
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, 2, 3]
Something.find(
:all,
:conditions => ['type_id in (?)', type_ids.join(',') ] )
Which will generate a sql fragment that looks like this:
[...] where events.status_id in (‘1,2,3′) [...]
Well, this will work just fine if you’re using MySQL, but not so fine (read ‘at all’) if you’re using SQLite. So, if you’re using MySQL for your development environment and SQLite for your test environment, like me, it will work fine in dev and fail in your tests.
So, instead, just let ActiveRecord’s sanitizers do their job and write:
Something.find(
:all,
:conditions => ['type_id in (?)', type_ids])
Your sanity will thank you.
Posted: November 17th, 2008 | Author: abel | Filed under: Design, Great Minds | 2 Comments »
Hey again,
As you know from my previous post, I’ve been learning a bit about color and design. I’ve taken what I’ve learned to help redesign our game site, Great Minds, from this:

Great Minds Homepage, v1.1
…to this:

Great Minds Homepage, v1.9
…and finally this:

Great Minds Homepage, v2.0
Obviously there’s a bunch of important stuff going on between v1.1 and v1.9, but there are very subtle, yet important things happening between v1.9 and v2.0.
Read the rest of this entry »