24

I'm trying to learn as much as I can about AREL. But I'm not sure what to look at.

I found some documentation on rubydoc, but it doesn't seem very good in terms of showing what are the "public API"/accessible things I can do. For example, I could not find any information on the "includes" method.

So, how exactly to learn most of what AREL has to offer? (i.e. without delving into the source code)

Zabba
  • 64,285
  • 47
  • 179
  • 207

5 Answers5

18

I got tired of reading tests and code, in the arel tree, so I put some slides together. They cover v2.x, I haven't even looked at v3 yet.

Philip C
  • 691
  • 7
  • 18
8

I wrote an article about Arel a few weeks ago (The definitive guide to Arel, the SQL manager for Ruby). It walks through the whole library and explains how things work internally and how you can use it from your own application.

Jiří Pospíšil
  • 14,296
  • 2
  • 41
  • 52
5

I think that this will be useful :

https://github.com/brynary/arel

And an interesting asciicast :

http://asciicasts.com/episodes/215-advanced-queries-in-rails-3

Spyros
  • 46,820
  • 25
  • 86
  • 129
  • 13
    Unfortunately, that's hardly any documentation. I can't even find the word "includes" on that page. I was looking for something more thorough.. – Zabba Apr 16 '11 at 21:09
  • includes is an active record method, so it won't probably be there, or just may be as an example. – Spyros Apr 16 '11 at 21:15
  • There is an asciicast that also has some nice info, i'm adding it to the post. – Spyros Apr 16 '11 at 21:18
  • Other than those resources, i don't think there is something more detailed to tell you the truth. – Spyros Apr 16 '11 at 21:19
4

Yeah, I'm having a real hard time finding doc too. The Arel test suite might be of some use:

https://github.com/rails/arel/blob/master/test/test_select_manager.rb

Purplejacket
  • 1,808
  • 2
  • 25
  • 43
2

Complete documentation is here: http://rubydoc.info/github/rails/arel/master/Arel Look in the modules for specific methods.

Christian
  • 37
  • 3