Import has_many IRows
IRow belongs to Import

@import = Import.find(params[:id])

Shouldn't both of the following statements work the same?

#1 :@i_rows = @import.i_rows(:order => :row_sort)
      Generates: SELECT * FROM "i_rows" WHERE ("i_rows".import_id =
4)

#2 @i_rows = IRow.find_all_by_import_id(@import.id, :order
=> :row_sort)
     Generates: SELECT * FROM "i_rows" WHERE ("i_rows"."import_id" =
4) ORDER BY row_sort

What is wrong with #1. It returns same data as #2, but just not
sorted. No syntax or SQL errors are generated by #1.

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

Reply via email to