I tried to define a default_scope in the following way:
default_scope :joins => :product, :select => "catalog_products.*, products.*"
What I'm getting from Rails though is this:
SELECT catalog_products.* FROM `catalog_products` INNER JOIN `products` ON `products`.id = `catalog_products`.product_id
When I define it as a named_scope, everything is fine:
named_scope :extended, :joins => :product, :select => "catalog_products.*, products.*"
SELECT catalog_products.*, products.* FROM `catalog_products` INNER JOIN `products` ON `products`.id = `catalog_products`.product_id
Is this supposed to be a bug or is it a correct behavior?
I'm using Rails 2.3.4.
Thanks!