composite-primary-keys / composite_primary_keys

Composite Primary Keys support for Active Record
1.03k stars 350 forks source link

SQL*Server fail on insert #521

Closed net1957 closed 4 years ago

net1957 commented 4 years ago

upgrading a application from Rails 5.x to 6.0 give the error "wrong number of arguments (given 3, expected 5)"

it seems the signature of sql_for_insert in lib\composite_primary_keys\connection_adapters\sqlserver has to be changed from sql_for_insert(sql, pk, id_value, sequence_name, binds) to def sql_for_insert(sql, pk, binds)

This change is already present in PostgreSQL ConnectionAdapters

After this modification my application is working as expected.

I use the gem 'activerecord-sqlserver-adapter', '6.0.0.rc1'

cfis commented 4 years ago

Hmm, that was done quite a while ago. See:

https://github.com/composite-primary-keys/composite_primary_keys/blob/master/lib/composite_primary_keys/connection_adapters/sqlserver/database_statements.rb

Am I missing something?

net1957 commented 4 years ago

My bad ! Didn't check the repo, but the version on my computer...

But when can we expect a release to rubygems ?

cfis commented 4 years ago

Ah sorry - I thought it was released. I'll make a new release.

cfis commented 4 years ago

Ok new gem version released.