sql - Arel (Rails) Is it possible to make complex query? -


i need create query db using any/all. after research arel possibilities found out arel doesn't have short commands (like eq, lt, gt etc) has arel::sqlliteral 1 example. me not obviousl how can use classic query this:

select column_name(s) table_name column_name operator (select column_name table_name condition); 

instead of query in example. show me how should like?

you may activerecord methods, without usage of arel:

sub_query = model.select(:column_name).where(condition).to_sql model.   select("column_name(s)").   where("column_name operator (#{sub_query})") 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -