[Rails] Re: Filter out or not showing event records that are in the past

2009-08-17 Thread kevin lee
With your guidance, I have now seen named_scope work in my simple app by invoking it in an action! Thanks! Hassan Schroeder wrote: On Wed, Aug 12, 2009 at 12:24 PM, kevin leerails-mailing-l...@andreas-s.net wrote: I have generated a simple event app to learn and try to debug

[Rails] Re: Filter out or not showing event records that are in the past

2009-08-12 Thread kevin lee
I have generated a simple event app to learn and try to debug named_scope. But still have problem. My problem is still have not figure out how to call the named_scope (i.e. Event.upcoming). Not knowing exactly how, I tried to invoked it in various spots in the controller and also the view

[Rails] Re: Filter out or not showing event records that are in the past

2009-08-12 Thread Hassan Schroeder
On Wed, Aug 12, 2009 at 12:24 PM, kevin leerails-mailing-l...@andreas-s.net wrote: I have generated a simple event app to learn and try to debug named_scope.  But still have problem.  My problem is still have not figure out how to call the named_scope (i.e. Event.upcoming). Ex: named_scopes

[Rails] Re: Filter out or not showing event records that are in the past

2009-07-29 Thread kevin lee
I use ActiveScaffold in my project. I posted, perhaps stupidly, a question on AS help forum on whether it supports named_scope and no one replies for days now. I also could hardly find named_scope discussion on that forum. Hassan Schroeder wrote: On Sun, Jul 26, 2009 at 7:02

[Rails] Re: Filter out or not showing event records that are in the past

2009-07-29 Thread Hassan Schroeder
On Wed, Jul 29, 2009 at 10:40 AM, kevin leerails-mailing-l...@andreas-s.net wrote: I use ActiveScaffold in my project.  I posted, perhaps stupidly, a question on AS help forum on whether it supports named_scope I know zip about ActiveScaffold, but I imagine you would get more useful help if

[Rails] Re: Filter out or not showing event records that are in the past

2009-07-27 Thread Hassan Schroeder
On Sun, Jul 26, 2009 at 7:02 PM, kevin leerails-mailing-l...@andreas-s.net wrote: I tweaked the sample code for my model and called MyModel.NameofScope (i.e. Event.upcoming) in the model.  To my surprise, it has no effect. I also tried one or two other conditions.  I looked at the log and

[Rails] Re: Filter out or not showing event records that are in the past

2009-07-26 Thread kevin lee
I tweaked the sample code for my model and called MyModel.NameofScope (i.e. Event.upcoming) in the model. To my surprise, it has no effect. I also tried one or two other conditions. I looked at the log and there is nothing related to named_scope. I use fixtures to load data into the

[Rails] Re: Filter out or not showing event records that are in the past

2009-07-12 Thread Matt Jones
Try this in your event model: named_scope :upcoming, lambda { { :conditions = ['happens_at ?', Time.now] } } I've assumed that your scheduled date is named 'happens_at'; tweak as needed. --Matt Jones On Jul 11, 4:05 pm, kevin lee rails-mailing-l...@andreas-s.net wrote: My app shows a list