Flowdock

Notes posted by netmaniac

RSS feed
April 23, 2009
1 thank

Using strings as association names

Beware, that using strings as association names, when giving Hash to :include will render errors:

The error occurred while evaluating nil.name

So, :include => [‘assoc1’, ‘assoc2’ ] will work, and :include => [ {‘assoc1’ => ‘assoc3’}, ‘assoc2’] won’t. Use symbols:

Proper form

:include => [ {:assoc1 => :assoc3}, ‘assoc2’]