I have a rather complex algorithm that needs to return an ordered result
set, the only problem is that the results contain rows for two different
tables, thus meaning if I do Images.find_by_sql, the rows that aren’t
will be encapsulated by an Image object. The solution I have in mind is
create an ImageIntermediate model, which will return the correct object
a row based on the value inside a column. The problem is that
will think the object returned by ImageIntermediate will be a new
can override this with instance_variable_set("@new_record", false), but
that’s pretty hacky.
Does anyone have a better solution to this problem?