fixes an issue with has_many_through and polymorphic associations

Unfortunately there is a bug in my last fix in the case of using the 'source' option and not using 'source_type'.
The join sql phrase may have a condition that is not needed and have a column name that doesn't exist, resulting in sql error.
The correct syntax that uses both source and source_type is explained in the first answer here:
http://stackoverflow.com/questions/1683265/activerecord-has-many-through-and-polymorphic-associations.
This patch fixes the issue, sorry for the inconvenience.