Displaying 1 result from an estimated 1 matches for "eventsa".
Did you mean:
events
2006 Feb 06
0
Sorting records from multiple tables, on different fieldnames
...own
as the "Actually, you know what *would* be great, and we *should* have
requested this up front..." request. Grrr!
Is there a reasonably elegant Rails-ish or Ruby-ish way to do this
(bearing in mind the different date fieldnames in each table), or
should I resort to something like:
@eventsA = A.find(:all)
@eventsB = B.find(:all)
@eventsC = C.find(:all)
@events_all = @eventsA.push(@eventsB).push(@eventsC)
@events_all.each do
|event|
try
# See if the datedue field exists in this record; rescue if not...
if event.datedue
...
which is *really* ugly?
Thanks in advance
Dave...