active-relation
Link two models through middlemodel at Rails 3.x
I guess that I do not know the right terminology yet, thus find it difficult to find the right answer.[详细]
2023-03-21 08:28 分类:问答Rails :include doesn't include
My models: class Contact < ActiveRecord::Base has_many :addresses has_man开发者_开发问答y :emails[详细]
2023-03-17 01:45 分类:问答Exclude conditions in active relations, how?
I am seeking a way to do the opp开发者_如何学JAVAosite of : Model.where(:name => \'julian\') Something like :[详细]
2023-03-08 10:23 分类:问答How to sort forum's users by "total_content_length" and then by most recent post?
I would like to sort forum\'s users by total_content_length. To get the top n writers in the forum I do:[详细]
2023-03-07 19:33 分类:问答Rails 3 ActiveRelation adding "is null" on a join... how do I stop it from doing that?
I am trying my first join and the sql that it\'s generating is very odd. I have a Recipient belongs to a User. I am trying to query all the recipients by a user that are also not read and not deleted[详细]
2023-03-02 15:45 分类:问答Why/How is a class method accessible to an array of records only through an association in Rails 3?
Consider a simple example, where we have 2 models, Article and Category. class Article < ActiveRecord::Base[详细]
2023-02-21 02:53 分类:问答why is message_id_equals method missing in Rails 3?
I seem to have this error, and I\'m not doing anything special: NameError (undefined method `message_id_equals\' for class `ActiveRecord::Relation\')[详细]
2023-02-19 23:23 分类:问答Rails3 & ActiveRecord::Relation - Arel and OR
I have some scopes definied in a Model called Events. Now I need join them using OR operator. I’m using Rails3 and I’m a bit confused with ActiveRelation & Arel and how and how I should use this[详细]
2023-02-16 09:41 分类:问答How do I get Rails to eager load counts?
This is related to a question a year and change ago. I put up an example of the question that should work out of the box, provided you have sqlite3 available: https://github.com/cairo140/rails-eager-[详细]
2023-02-08 13:35 分类:问答How to exclude an array of ids from query in Rails (using ActiveRecord)?
I would like to perform an ActiveRecord query that returns all records except those records that have certain ids.The ids I would like excluded are stored in an array.So:[详细]
2023-02-02 18:03 分类:问答