# Multiple args with named scope.. problem

**URL:** <https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208>\
**Category:** Rails\
**Created:** [March 6, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208 "2009-03-06T19:40:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [March 6, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208/1 "2009-03-06T19:40:45Z")

</div>

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 ‘=’

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [March 6, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208/2 "2009-03-06T19:47:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [March 6, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208/3 "2009-03-06T20:04:25Z")

</div>

well that got rid of the first error but now it says that i

undefined method `schedule\_limits’

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [March 6, 2009, 9:38pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208/4 "2009-03-06T21:38:58Z")

</div>

On Mar 6, 7:04 pm, Morgan M. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [March 6, 2009, 11:21pm UTC](https://www.ruby-forum.com/t/multiple-args-with-named-scope-problem/162208/5 "2009-03-06T23:21:33Z")

</div>

Frederick C. wrote:

> On Mar 6, 7:04ï¿½pm, Morgan M. [removed\_email\_address@domain.invalid](mailto: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.
