我有两个带有用户表的数据库,foreign_key为a_user_id
database_a.users.id, database_a.users.name
database_b.users.id, database_b.users.a_user_id
用户类将与database_a的表相关。
User.joins('INNER JOIN AS b_users ON database_b.users.a_user_id = database_a.users.id')
它引起语法错误:ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax