arel
Rails 3: Arel for NOT EXISTS?
How do you write a NOT EXISTS in Arel? I\'m having trouble translating this query into Arel: SELECT * FROM deals[详细]
2023-03-30 11:57 分类:问答Use SQL functions for insert/update in ActiveRecord
I want to store IP addresses (v4 and v6) in my rails application. I have installed an extension to MySQL adds functions to convert ip strings to binary which will allow me to query by IP range easily.[详细]
2023-03-29 16:15 分类:问答ARel mimic includes with find_by_sql
I\'ve got a fairly complex sql query that I\'m pretty sure I can\'t accomplish with ARel (Rails 3.0.10)[详细]
2023-03-29 08:21 分类:问答Can you join another table that isn't an association in ARel?
I\'ve got some SQL that\'s working when I want to look for particular pages that have the particular schemes assigned to it (all through the scheme_assignment):[详细]
2023-03-28 16:29 分类:问答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 coins.[详细]
2023-03-27 12:25 分类:问答Making Rails #destroy_all run faster
I want to run Alarm.destroy_all, though, each alarm is associated to many AlarmEvents, and each AlarmEvent is associated to many AlarmEvent::Measurements,being both associations marked as :dependent=&[详细]
2023-03-25 20:21 分类:问答Shortening up respond_with( :include => xxx)
I\'m looking for a way to shorten up the :include => :child inside a respond_with which generates json.[详细]
2023-03-25 05:17 分类:问答Rails Arel and Active Record predicates
I might be lacking some understanding concerning Arel objects in Rails. You can do something like: u = User.arel_table[详细]
2023-03-23 23:03 分类:问答Ruby / Rails - Can I use a joined table's scope(or class method) as part of my WHERE clause?
I want to grab all the categories that contain purchaseable products. class Product < ActiveRecord::Base[详细]
2023-03-23 22:18 分类:问答In Rails 3 how can I select items where the items.join_model.id != x?
In my Rails models I have: class Song < ActiveRecord::Base has_many :flags has_many :accounts, :through => :flags[详细]
2023-03-21 15:47 分类:问答