Forum: Ruby on Rails Multiple args with named scope.. problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Morgan M. (Guest)
on 2009-03-06 20:40
i'm trying to figure out what i'm doing wrong here.

  named_scope :schedule_limits, lambda { |*args| {:conditions => ["id =
? and sched_start > ? and sched_start < ?" , ( args[0], args[1],
args[2]) ]} }


it just produces the error

/dir/dir/dir/schedule.rb:9: syntax error, unexpected ')', expecting '='
Frederick C. (Guest)
on 2009-03-06 20:47
(Received via mailing list)
On 6 Mar 2009, at 18:40, Morgan M. wrote:

> /dir/dir/dir/schedule.rb:9: syntax error, unexpected ')', expecting
> '='

because you shouldn't have those () you;ve got there.

Fred
Morgan M. (Guest)
on 2009-03-06 21:04
well that got rid of the first error but now it says that i

undefined method `schedule_limits'
Frederick C. (Guest)
on 2009-03-06 22:38
(Received via mailing list)
On Mar 6, 7:04 pm, Morgan M. <removed_email_address@domain.invalid>
wrote:
> well that got rid of the first error but now it says that i
>
> undefined method `schedule_limits'

That sounds like it's coming from a different line. show the whole
error message and model and things might become clearer.

Fred
Morgan M. (Guest)
on 2009-03-07 00:21
Frederick C. wrote:
> On Mar 6, 7:04�pm, Morgan M. <removed_email_address@domain.invalid>
> wrote:
>> well that got rid of the first error but now it says that i
>>
>> undefined method `schedule_limits'
>
> That sounds like it's coming from a different line. show the whole
> error message and model and things might become clearer.
>
> Fred

I figured it out just in time to not need the whole shebang (at least i
did learn something though).   figures.    thank you very much for your
help.
This topic is locked and can not be replied to.