Ruby Version: 1.8.2
Rails Version: 0.14.3
I am having a problem with the ActiveRecord::Base ‘find’ method. The
problem occurs when I specify a join statement on a table that happens
to have fields with the same name. In this case, both the students and
academic_supervisor tables have id, fisrtName and lastName fields.
Notice the differences between these to calls. The academic_supervisor
values seem to be overwriting the student values.
irb(main):040:0* puts Student.find( :first ).to_yaml
Call #2 (with join)
irb(main):049:0* puts Student.find( :first, :joins => ‘JOIN
academic_supervisors on academic_supervisors.id =
Am I missing something here? Is this a known issue? Is there a
work-around? BTW, I am using the ‘paginate’ method in my app, so
find_by_sql is not an option.