# Weird hmt + polimorphic association behavior

**URL:** <https://www.ruby-forum.com/t/weird-hmt-polimorphic-association-behavior/137603>\
**Category:** Rails\
**Created:** [May 14, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/weird-hmt-polimorphic-association-behavior/137603 "2008-05-14T16:00:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [May 14, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/weird-hmt-polimorphic-association-behavior/137603/1 "2008-05-14T16:00:36Z")

</div>

The problemic model: [http://pastie.caboo.se/196775](http://pastie.caboo.se/196775)

> > u.profile.observable\_artists\_as\_string  
> > ActiveRecord::StatementInvalid: Mysql::Error: Unknown column  
> > ‘users.user\_id’ in’where clause’: SELECT observations.\* FROM  
> > observations INNER JOIN users ON obervations.user\_id = users.id  
> > WHERE ((users.user\_id = 1) AND ((observable\_typ=‘Artist’)))

The problem

users.user\_id should be observations.user\_id

Is it a bug in Rails core?
