aboutsummaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 16:17:13 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 16:17:13 -0700
commit07f7f752fecb56316456f144c121e471fd0d0847 (patch)
treeefe4da65736e808ecae0c7850e4d1fe32470c037 /README
parentaf3d7c5193eee90ad17b1ba8aaf5d76a2874c0a5 (diff)
downloadrails-07f7f752fecb56316456f144c121e471fd0d0847.tar.gz
rails-07f7f752fecb56316456f144c121e471fd0d0847.tar.bz2
rails-07f7f752fecb56316456f144c121e471fd0d0847.zip
renamed operators
- equals / eq - greater_than / gt - etc.
Diffstat (limited to 'README')
-rw-r--r--README6
1 files changed, 3 insertions, 3 deletions
diff --git a/README b/README
index 54a698c768..87e9678df6 100644
--- a/README
+++ b/README
@@ -42,7 +42,7 @@ As you can see, the `relation` named `users` does not represent an individual qu
Following the Relational Algebra, Arel's interface uses some jargon that differs from standard SQL. For example, in order to add a `WHERE` clause to your relations, you use the `select` operation:
- users.select(users[:name].equals('amy')) # => SELECT * FROM users WHERE users.name = 'amy'
+ users.select(users[:name].eq('amy')) # => SELECT * FROM users WHERE users.name = 'amy'
What would, in SQL, be part of the `SELECT` clause is called here a `projection`:
@@ -50,12 +50,12 @@ What would, in SQL, be part of the `SELECT` clause is called here a `projection`
Joins are fairly straightforward:
- users.join(photos).on(users[:id].equals(photos[:user_id])) => SELECT * FROM users INNER JOIN photos ON users.id = photos.user_id
+ users.join(photos).on(users[:id].eq(photos[:user_id])) => SELECT * FROM users INNER JOIN photos ON users.id = photos.user_id
The best property of the Relational is compositionality, or closure under all operations. For example, to select and project:
users \
- .select(users[:name].equals('amy')) \
+ .select(users[:name].eq('amy')) \
.project(users[:id]) \
# => SELECT users.id FROM users WHERE users.name = 'amy'