named-scope
Named Scope Extensions - Calling Method Outside Do Block
I have the following named_scope in my User model: named_scope :all_stars, :joins => [:all_stars] do[详细]
2023-02-23 14:45 分类:问答Using named scope
I have a schedule model hav开发者_开发知识库ing start time as date time and duration in minutes as integer.[详细]
2023-02-20 23:32 分类:问答named_scope for sum of column in related table
My SQL skills are laughable at best, which is why Rails and ActiveRecord make my life a lot easier. This time, however, it probably represents a crutch that keeps me from understanding what\'s going o[详细]
2023-02-20 18:11 分类:问答Iterating over a has_many collection within a named_scope
Here are my models: class Message < ActiveRecord::Base has_many :comments attr_accessible :read #bool[详细]
2023-02-17 01:44 分类:问答Why does this named_scope create a NoMethodError?
I don\'t see where this code is creating this NoMethodFound error, and would really like any helpful suggestions.[详细]
2023-02-16 20:46 分类:问答Dynamic `named_scope` depending on certain criterias
dear all, i have a Student model that i\'ve specified some name_scope in it, e.g. from_program, from_year, from_school, has_status, from_course, etc...[详细]
2023-02-15 18:40 分类:问答Will this work with named_scope in rails?
I can\'t find the answer to this anywhere, and I don\'t have the brainpower left开发者_如何学编程 today to think up a way to confirm it on my own.[详细]
2023-02-14 10:05 分类:问答Make any order chainable
I want to sort my Person model objects based on a complicated开发者_JS百科 criterion that can\'t be summarized in a single query - and so in a named scope. Right now I use a class method like:[详细]
2023-02-11 23:47 分类:问答association followed by named scope yields duplicate SQL query
I came across this strange issue at work so I created a minimal app to highlight the problem. I have two models with a simple association:[详细]
2023-02-10 06:11 分类:问答Rails - named scope issue (depends on number of children in a many_to_many relationship)
Let\'s say I have a many-to-many relationship between users and group. A user can be a member of a group, or his application can still be pending.[详细]
2023-02-09 11:01 分类:问答