Rails 3 sometimes fails on inherited model find() qeury as type=0

rails 3 sometimes fails on inherited model find() qeury as type=0

Example :
class Student < ActiveRecord::Base
end

class SrStudent < Student
end

class JrStudent < Student
end

JrStudent.find(:all, :conditions => [“status=1”])
or

SrStudent.find(:all, :conditions => [“status=1”])

Log query seems like :
SELECT students.* FROM students WHERE students.type = 0 AND
(students.status = 1)

In that query it auto set type=0 instead of its relevant class name.

These same contents was working fine with rails 2.3.8

NOTE:It sometimes fails on rails 3 like with above query, not every
time!

Any suggestion ??

-Ganesh K

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs