Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorkkrzyzak
    I would like to implement habtm relationship on site_user model. So, site_user has and belongs to many friends (friend should be an alias for site_user model).
    I've tried:
    var $habtm = array('friends'=>array('class_name'=>'SiteUser',
    but I've got an error:
    Tried 'SELECT site_users.* FROM site_users LEFT OUTER JOIN site_users_site_users ON site_users_site_users.friend_id = site_users.id LEFT OUTER JOIN site_users ON site_users_site_users.site_user_id = site_users.id WHERE site_users.id = 54'. Got: [1066] Not unique table/alias: 'site_users'

    Any hints will be greatly appreciated
    Sorry for my language errors - English isn't my native lang.

    habtm on the same model are only tested in Akelos like

    class Friend extends ActiveRecord {
        public $habtm = array('friends' => array('association_foreign_key' => 'related_id'));

    If you could submit a ticket with a failing test including Migrations and Models, we will be able to reproduce your bug.