About Arel is an SQL abstraction library built into Ruby on Rails. https://github.com/rails/arel Tables users = Arel::Table.new(:users) users = User.arel_table # ActiveRecord model Fields users[:name] users[:id] where (restriction) users.where(users[:name].eq('amy')) # SELECT * FROM users WHERE users.name = 'amy' select (projection) users.project(users[:id]) # SELECT users.id FROM users join basic