I have a complex named scope like the following.

named_scope :foo, lambda {|foo, bar|
    foo.each do |d|
      #foo = "this line doesn't work #{s}"
      baz = "something like this works " + s
    end

    bar.each do |b|
    end
{
  :conditions => {'baz' => 1}
}}

It does some pre-processing to calculate the :conditions hash. The
weird bit is that I get a bizarre syntax error when I try to use
double quoted strings with substitutions. If I use a syntax such as
"A"+str+"B" it's ok, but "A#{str}B" is a syntax error. Any thoughts?

I've tried to replicate it in pure ruby lambda functions but wasn't
able to, leading me to think it may be related to the named scope.

-Jeff

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to