named-scope
How do I call all comments for a post (workout in this case) where workout.user_id == current_user.id?
I have created a Ruby on Rails app where users can record their workouts and other users can comment on those workouts. I am using a Dashboard resource to aggregate information for current_user. I am[详细]
2023-01-28 02:05 分类:问答Why does Rails generate duplicate SQL conditions when using scopes with associations?
I have setup a model structure which allows different models to associate with a File model through a has_many ... :through ... association which is also polymorphic so that a File can belong to many[详细]
2023-01-27 14:23 分类:问答Problem with Thinking Sphinx and scopes
For several hours now I am unsuccessfully trying to get sphinx scopes work. I want to scope tags of ActsAsTaggableOn. In my model (that is taggable) I tried the following scopes:[详细]
2023-01-26 14:26 分类:问答Getting the logic out of the view...help with named_scope
I have created an application where I am allowing users to log their Workouts. The user has the ability to keep a private or public log of their workouts and is denoted by a check_box field that pass[详细]
2023-01-26 08:37 分类:问答Is there named scope's analog for Doctrine2?
Does Doctrine2 have a features similar to ActiveRecord\'s named scopes?开发者_如何学GoThere isn\'t one baked into D2, but it probably wouldn\'t be too much of a stretch to implement a system similar t[详细]
2023-01-24 20:46 分类:问答Rails order based on association
I have a Problem and a Solution model. Problem has many solutions and Solution belongs to problem. I need to get the recently solved problem, that means, get the last X solutions an开发者_运维问答d g[详细]
2023-01-23 20:31 分类:问答Is there a way to create a named scope that groups?
I have the following using searchlogic: @todos = Todo.contact_user_id_is(current_user). contact_campaign_id_is(@campaign).[详细]
2023-01-23 04:50 分类:问答Rails Nested Form - Filter by Current User, Lesson-Questions-Answers-Users
I have a nested form that is based on the following model -- A lesson has many questions, each question has many answers, and answers belong to users.[详细]
2023-01-21 07:55 分类:问答Confused using "using" Statement C#
According to MSDN Library using Statement (C# Reference) Defines a scope, outside of which an object or objects will be disposed.[详细]
2023-01-21 05:02 分类:问答Override a scope in rails 3
I want to override an existing scope to开发者_如何学Python add an extra condition to it. I\'ve shown my attempt to do this using alias_method. Unfortunately this approach doesn\'t work with scopes, I[详细]
2023-01-21 00:02 分类:问答