Arel is a Relational Algebra for Ruby.
Using the rails 3 style how would I write the opposite of: Foo.includes(:bar).where(:bars=>{:id=>nil}) …
ruby-on-rails rails-activerecord arelSuppose I have the following two objects: first_name_relation = User.where(:first_name => 'Tobias') # ActiveRecord::Relation last_name_…
ruby-on-rails rails-activerecord arelI want to do something like: SELECT * FROM USER WHERE NAME LIKE '%Smith%'; My attempt in Arel: # params[:…
ruby-on-rails activerecord arelI have a Rails 3 project. With Rails 3 came Arel and the ability to reuse one scope to build another. I …
ruby-on-rails activerecord ruby-on-rails-3 named-scope arelConsider a simple association... class Person has_many :friends end class Friend belongs_to :person end What is the cleanest …
ruby-on-rails arel meta-whereWith SQL I can easily do sub-queries like this User.where(:id => Account.where(..).select(:user_id)) This produces: …
ruby-on-rails-3.1 subquery arelIs it possible to combine multiple CTEs in single query with arel? I am looking for way to get result …
sql postgresql common-table-expression recursive-query arelHow can you combine 2 different conditions using logical OR instead of AND? NOTE: 2 conditions are generated as rails scopes and …
sql ruby-on-rails ruby activerecord arelI have a default scope on products due to information security constraints. class Product < ActiveRecord::Base has_many :photos …
ruby-on-rails ruby-on-rails-3 scope arelWhere I used to do this: Foo.find_by_bar('a-value') I can now do this: Foo.where(:bar => …
ruby-on-rails ruby activerecord arel