On Jan 12, 1:03 am, Tomoaki Hayasaka <[email protected]>
wrote:
> > > named_scope :viewable, lambda {|acting_user| {:conditions =>
> > > “#{acting_user.signed_up??1:0}=1 or lifecycle_state='published'"
> > > }}
 thks. Tomoaki,

that's it. There must be spaces between ? and ? and 0 and : and 1. Now
everything is ok.

> There's a space missing between ? and 1.  ?1 is parsed as a fixnum
> (ruby 1.8) or a string literal (ruby 1.9).
>
> >> ?1
>
> => "1"  # in ruby 1.9>> nil.nil? ? 2 : 3
> => 2
> >> nil.nil?? 2 : 3
> => 2
> >> nil.nil? ?2 : 3
>
> SyntaxError: (irb):14: syntax error, unexpected ':', expecting $end
>
> -----
> Tomoaki Hayasaka <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to