LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Problem with sort_by{rand}

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-14-2009, 01:54 PM
ideaoforder ideaoforder is offline
Member
 
Join Date: Jul 2008
Posts: 28
Default Problem with sort_by{rand}

I'm running a RoR survey application that randomized question/answer order on a page using something like: answers.sort_by{rand}

This happens on several pages, each generating its own random number (in the view).

This sets the order on page render. It works fine on my local machine in both production and development mode running Mongrel, but doesn't work on my production server running Litespeed 4.0.3 (or 3.3 before that).

Strangely, when I restart the server, the value of rand appears to change. But it's the same for every page.

So it seems like this is some sort of caching problem where rand is only getting generated once.

Any ideas?

Thanks!
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:58 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.