This project is archived and is in readonly mode.
Bug in nested_attributes with 2.3.5?
-
Eloy Duran
- Assigned user changed from Eloy Duran to José Valim
-
José Valim
Could you please create a failing test case?
-
PeterW
Hi José
I apologize it took me a long time to get back to you.
I have created a simple app that shows the problem (calling http://localhost:3000/test_nested_save for example). By simply changing the Rails version in environment.rb, you will see that it works fine with 2.3.2 but fails with 2.3.5.
Pierre
-
José Valim
Thanks Peter. But could you please try to add a failing test case in Rails test suite?
-
PeterW
I amended test/unit/object_a_test.rb with a test. Thing is, to be honest, I am not sure that's what you asked for. I don't really know how to "test" this in more details since it does almost nothing: it just creates instances of models and then links them as per the schema. It is the "save" itself on the "most parent" object that fails (it tries to save twice the same thing in the DB - as per my initial post).
Please let me know if you need something else.
-
José Valim
What I asked you is to clone Rails from Github source, run ActiveRecord test suite and add a new test (which fails) to ActiveRecord test suite. In a few steps:
git clone git://github.com/rails/rails.git cd rails vim Gemfile # Open your Gemfile and comment both mysql and pg gems cd activerecord rake test_sqlite3In the last step, you will execute ActiveRecord test suite with sqlite3. At this point, all tests should pass. Then you can open up activerecord/test/cases/autosave_association_test.rb and add a new test, which reproduces the failure you reported.
Can you please do it? If you need any help, feel free to ask!
-
Yehuda Katz (wycats)
- State changed from new to incomplete
-
José Valim
- State changed from incomplete to stale
Marking as stale. Let me know if you have any news.
