New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model.create! returns model with nil ID #690
Comments
Should I chalk this up to no Rails 3.2 support? |
This is not an issue on Rails 4.0 |
3.2 should be still working - just did no have the time to look into it yet |
Fair enough, I'll test any PR if you need. |
actually a small isolated test-case or piece of .rb script with everything in 1 place would help fix this sooner. |
tried a script as well as your repo - all seems well, you should upgrade your JRuby 1.7.x version :
|
* 1-3-stable: (25 commits) prepare for 1.3.20 Retrieve AM::Type::Boolean::FALSE_VALUES for Rails 5. backwards compat for previous commit (tracking removed TRUE_VALUES in AR) [travis-ci] the system call regression also relates to a Rails change in 4.2 [travis-ci] allow failures - yanother 9K BC timestamp issue + `` regression on 1.7.19 [travis-ci] a bit more 9K test targets (with AR 4.1 besides 4.2) + fix oraclejdk8 [test] trying to reproduce an issue with insert not returning id - without luck (#690) only mock mysql / mysql2 error under adapter /mysql/ and make sure db:create works use system instead of `` to run dumps (on < 4.0) as it has issues under 1.7.x [travis-ci] use latest JRuby 1.7 and do some testing against 9K, default JDK to 7 [test] maintain 1.8 syntax compatibility [test] adjust derby tests to conform to how default values are expected on AR 4.2 avoid column.default type_cast-ing on AR 4.2 - been causing some nesty bugs ... e.g. on postres as an array 'default' instance has been leaking into models [test] rename test file [test] adjust array column.default expectations to match AR under MRI on 4.1/4.2 [test] specify a column default test-case - values should not be type-casted on 4.2 [rake] test --use-color=t by default [test] match all *_test.rb files including those in sub-directories appraise latest 4.x versions [postgres] data_sources support - backport on AR 4.2 + hide internal constants compilant with rails/rails@d6eac0039abf2745f0fdf ...
I have a production Rails 3.2.22 JRuby app that uses activerecord-jdbcpostgresql-adapter version '1.2.9'.
Recently though, I've tried to upgrade to 1.3.19 for some bug fixes (namely .pluck support). However, it seems that a trivial Rails 3.2.22 app is broken with any version of activerecord-jdbcpostgresql-adapter 1.3.0+.
Any Model.create calls return a model/object with a nil ID rather than the new ID (aka primary key).
I've created a bare bones rails app to demonstrate this:
https://github.com/jrl08d/jruby_test
To reproduce:
The model that gets returned has a nil ID (which makes it more or less useless).
Environment:
The text was updated successfully, but these errors were encountered: