Top "Arel" questions

Arel is a Relational Algebra for Ruby.

Rails 4 - how to give alias names to includes() and joins() in active record querying

How can I give an alias name for e.g. includes()? Following is given: User: active record model Student: active …

ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 activerecord arel
Rails Arel selecting distinct columns

I've hit a slight block with the new scope methods (Arel 0.4.0, Rails 3.0.0.rc) Basically I have: A topics model, which …

ruby-on-rails activerecord arel
ActiveRecord Subquery Inner Join

I am trying to convert a "raw" PostGIS SQL query into a Rails ActiveRecord query. My goal is to convert …

ruby activerecord postgis arel rgeo
Issue when retrieving records with empty array

I have a table of around 100 Users and I also have an array of user ids. What I wanted to …

ruby-on-rails ruby-on-rails-3 postgresql activerecord arel
Where can I find good AREL documentation?

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

ruby-on-rails-3 documentation arel
ActiveRecord query with alias'd table names

Using model concerns which include scopes, what is the best way to write these knowing that nested and/or self-referencing …

ruby-on-rails activerecord arel
How to join a table and count records in Rails 3?

I have a Collection class which has many coins. I am trying to select collections which have more than two …

ruby ruby-on-rails-3 arel
How to join on subqueries using ARel?

I have a few massive SQL request involving join across various models in my rails application. A single request can …

sql ruby-on-rails-3 activerecord ruby-on-rails-3.2 arel
Join the same table twice with conditions

There are situations where ActiveRecord sets the alias table name if there are multiple joins with the same table. I'm …

sql ruby-on-rails-4 rails-activerecord arel
problem: activerecord (rails3), chaining scopes with includes

In Rails3 there seems to be a problem when chaining two scopes (ActiveRelations) that each have a different include: Consider …

ruby-on-rails activerecord ruby-on-rails-3 arel