May 9, 2015 by Daniel P. Clark

Chaining an Array into Arel ors

I’d like to keep this post short.  So the basic idea behind this is that Arel helps you build SQL queries.  When you want to join multiple queries together into one result you use Arel’s or method.  The way Arel chains additional query commands is by nesting inside the current query.  For example, if you…

Continue Reading »

January 27, 2015 by Daniel P. Clark

or

Truthiness Both or and || will return the first item that evaluates as true from the left side to the right.

In Ruby any Object that exists is considered true.  The only exceptions are false itself and nil.

Even unassigned symbols are considered true.

So whenever an or comparison is done only…

Continue Reading »