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
database (SQLite3) but I don't think it matters. My Rails version is
2.1 So how do I go about troubleshooting this problem? Any advice?
Thanks!
Matt Jones wrote:
> 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 <[email protected]>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---