Permalink
Browse files

Changed multiple-attribute selection to array syntax

  • Loading branch information...
1 parent 417f008 commit 61541ffc1db46e1a6bddd1947de6e9e8cbfe83b0 @peternixey peternixey committed Aug 1, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 README.md
View
@@ -467,12 +467,11 @@ p.flanderized_name
As you can see, just like functions, these operations can be given aliases.
-To select more than one attribute (or calculated attribute) simply chain your select statements:
+To select more than one attribute (or calculated attribute) simply put them into an array:
```ruby
-p = Person.select{name.op('||', '-diddly').as(flanderized_name)
- }.select{ coalesce(name, '<no name given>').as(name_with_default)
-}.first
+p = Person.select{[ name.op('||', '-diddly').as(flanderized_name),
+ coalesce(name, '<no name given>').as(name_with_default) ]}.first
p.flanderized_name
# => "Aric Smith-diddly"
p.name_with_default

0 comments on commit 61541ff

Please sign in to comment.