Quantcast

test for last row in object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

test for last row in object

fugee ohu
Seems my code is wrong here on the first line, anyone can help

unless p==@posts.last
    somevariable << ", "
end


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a1f37edc-12dd-4f56-9bb5-f39ba57dc56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: test for last row in object

Colin Law
On 5 May 2017 at 23:14, fugee ohu <[hidden email]> wrote:
> Seems my code is wrong here on the first line, anyone can help
>
> unless p==@posts.last

Are you expecting that to check all the attributes of p and
@posts.last and see if they are the same?

>     somevariable << ", "
> end
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/a1f37edc-12dd-4f56-9bb5-f39ba57dc56d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvyLbKzuZMtHnXCac0%3D_wOUWVbYEdCPO-yiEmCfxLuM3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...