named-scope
Rails3 - many_to_many relationships and scope chaining
Let\'s say I have a many_to_many relation ship between Articles and Tags class ArticleTag < ActiveRecord::Base[详细]
2023-03-07 10:03 分类:问答Multiple join query in a scope/named_scope
Is it possible to create a named_scope from the following query: SELECT g.*, b.* FROM users u LEFT JOIN band_users bu ON u.id = bu.uid[详细]
2023-03-06 04:30 分类:问答How can I find percent complete in ActiveRecord?
I can\'t seem to find an elegant way of doing this. 开发者_C百科 But let\'s say my model Projects has many Tasks.[详细]
2023-03-04 22:00 分类:问答Use named_scopes from a model, with another model
Is there any way to reuse named scopes defin开发者_JAVA技巧ed in a model, in another model. I have some generic named_scopes defined that do some filtering, and I would like to use them in another mo[详细]
2023-03-03 16:26 分类:问答Rails named_scope inheritance?
I\'m trying to generalize some of my models by providing a common base model to inherit from that contains some mutual named_scope declarations and a filter method that activates that search for simpl[详细]
2023-03-03 06:17 分类:问答Rails 3 complex associations using nested_has_many_through
I have been trying to develop a movie based rails application which has support for multiple regions (Hollywood, Bollywood etc). I call the multiple regions as languages in the application.[详细]
2023-03-03 05:21 分类:问答Named scope SQL syntax error
Looks like I have some problems with quotes? My named scope: named_scope :find_by_name, lambda {|name| {:conditions => [\"first_name LIKE \'%?%\' or last_name LIKE \'%?%\'\",name.split(\' \').fir[详细]
2023-02-28 11:13 分类:问答named_scope for date.today Rails 2.3.9
Working with a Rails 2.3.9 app and wondering how to write my named_scope such that I only get workouts from the current date. I am setting the timezone in in the application c开发者_运维百科ontroller[详细]
2023-02-28 04:54 分类:问答How to add a search capability in rails 3 app using the named scope?
HI Guys. I wanna know how can I make a simple search using named scope in rails 3. I have successfully done it in the console but I can\'t find any example that uses the views.[详细]
2023-02-26 02:38 分类:问答How to turn a self-table subquery SQL to a Rails named_scope?
I\'m using rails 2.3.10 and new to named_scope. I\'m dealing with a SQL which retrieves a list of last invitations of a particular event. I came up with a SQL with subquery and it looks like it can do[详细]
2023-02-24 16:27 分类:问答
加载中,请稍侯......