Sunday, July 11, 2010

[Rails] Re: Rails equivalent of Delphi SetRange()

Bb Serviss wrote:

Many thanks to everyone who replied, this is a great forum. Delphi has
been kind to me with the (visual component library) client data set
which allows me to make a single query, then scope the remaining records
in any way I see fit and loop through them, breaking out of the loop
anytime I see fit. I can also use summary functions on the cds to return
sum and count, etc, all without any further queries. Anyway, enough of
Delphi, the requirement to use Windows servers has finally killed Delphi
for me.

The basic tasks I need to learn in Ruby are

1. create an array of hashes (records). I guess this is the result of a
query. (cars = Car.all) but I also need to create them by hand
sometimes.

2. Loop through the array, reading each record (I figure I can test each
record rather than limit the records in the apparent dataset ala
SetRange and perform some processing.

3. Breaking out of the loop anytime a condition has been met (e.g. the
game has been booked).

I am sure there are plenty of material available to learn from. What I
really get from forums like this are hints as the the *best* way to go
about stuff. So far I am really enjoying RoR and have been playing with
it for over a year now and have made a couple of applications similar to
the Depot sample in the excellent book Agile Web Programming.

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate