alias_attribute causing "specified more than once" error upon import.
skunkworker opened this issue · 7 comments
In my model I am aliasing an attribute, when I try to import a record from an existing record, the INSERT INTO sql string has the aliased column name twice instead of once.
Rails 6.1.7.6
activerecord-import v1.5.0
The ActiveRecord Schema cache is also being used.
Eg:
class Foobar < ApplicationRecord
alias_attribute :myname, :name
end
Foobar.import(other_record)
=>
ActiveRecord::JDBCError: org.postgresql.util.PSQLException: ERROR: column "name" specified more than once
@leonidkroka any ideas how to resolve this issue?
Just to add more context, this seems specific to JRuby and PostgreSQL. I've added JRuby 9.4/AR 7 and 9.3/AR6 6.1 to the CI tests and they are passing 🤔
@skunkworker what version of activerecord-jdbcpostgresql-adapter gem do you have installed?
@jkowens activerecord-jdbcpostgresql-adapter (61.2-java)
We haven't moved to 9.4 yet because it's not stable enough for production use.
@skunkworker I have jruby back in the CI, could you possibly create a PR with a failing test to demonstrate the issue?