Ambiguous "id" column when using joins #16

Closed
EddM opened this Issue Aug 2, 2011 · 1 comment

Projects

None yet

1 participant

@EddM

When you bring joins into the picture when defining :conditions for models to be added to the sitemap, the primary_column is still assumed to be id. Therefore, when splitting result sets, you're left with a query that looks for models with an (ambiguous) id > 123. Invalid SQL, as you'd expect.

One would assume this could be fixed by passing a custom primary_column of, for example, posts.id, but this causes another issue when the gem attempts to call the primary_column method on the objects in question (for example, this would call posts.id upon a Post).

@EddM

My bad, should have just started a pull request instead of an issue.

#17

@EddM EddM closed this Aug 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment