I have a class hierarchy looks like this:
class Post < ActiveRecord::Base; end
class Project < Post; end
class ProjectDesignWall < Project; end
There's a controller that fetches data like so:
@projects = Project.find(:all, :include => [:project_image_photos,:user])
In development
, this runs the following query, straight from the logs:
SELECT * FROM `posts` WHERE ( (`posts`.`type` = 'Project' ) ) ORDER BY originally_created_at DESC
However, as soon as it's run in production
mode, even with the same database and data, it results in the following query:
SELECT * FROM `posts` WHERE ( (`posts`.`type` = 'Project' OR `posts`.`type` = 'ProjectDesignWall' ) ) ORDER BY originally_created_at DESC
Does anyone know why this is happening, and is there any way to get it to at least behave consistantly, if not outright fix the problem?