Mark Horrocks wrote:
> Marnen Laibow-Koser wrote:
>> I'm still not completely sure I understand  exactly what you're doing, 
>> but it looks to me like you're running onto trouble because you're 
> 
> If I want to re book courts after a game redraw part of the way through 
> a competition, its necessary to check the previous game time bookings 
> and find a time which has not been played before or find the time which 
> has not bee played for the longest time.

That calculation should be done in the DB if possible.  Then you don't 
need SetRange to make your app efficient. 

Again: your basic design, to the extent that I understand it, seems 
quite bad.  You're reinventing the DB in the app. 

If you disagree, please explain your data structure in more detail. 

[...]
> SetRange allows me to reduce the number of past games visible on each 
> pass of a dataset and then return it to the full set for the next future 
> game to be tested or the next team to be tested, or the next time to be 
> tested. This way I can query the past games only once, and then change 
> the range of visible games on it many times while looking for optimal 
> times to book each future game to be booked.
> 
> I can't find this ability in Rails.

Huh?  A Rails "recordset" is simply an array.  You can take a piece of 
it just as you would from any other Ruby array.  There's no explicit 
SetRange because you can just use array slicing. 

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to