Subject: | aliasing hiccup |
I don't know if you want to call this a bug or not, but it caused some minor heartburn so I
thought I'd report it.
DBIx::Class uses the relationship name as an alias when you join two tables together. In my
case I was using a reserved word as a relationship name. The app was working fine until I
joined these two tables together, and then it broke for what seemed like no reason until I
realized what was going on.
In this case I'm writing an order management system, so I used the word "order". In hind site
that was not the smartest move on my part. That said, perhaps there could either be a
warning about using a reserved as a relationship name, or if someone does use a reserved
word, or better yet, we could apply some existing functionality a bit more consistently. I know
that if you join a table to itself you get alias_2, and alias_3, etc. If the first alias always had
_1 on the end then it would never cause a conflict.
So that's my suggestion. Add a _1 to the end of the first instance of an alias.