auto_actions_for ignores failed validation
Reported by Don Ziesig | February 6th, 2011 @ 12:04 AM | in Hobo 1.4
agent.rb
Agent
has_many :documents
children :documents
document.rb
belongs_to :agent
has_many :contents
children :contents
validates_presence_of :name
validates_uniqueness_of :name
document_controller.rb
auto_actions_for :agent, [:create]
I have these in a relatively simple test app. which has tabs for all tables (will not be present in deployed app).
If I add duplicate or empty documents using the Documents tab, I get an appropriate error return and the tables remain correct. (They have no agent owner which is incorrect in the deployed app, but doesn't matter for this test).
If I select an agent, the Add Document field appears below the list of Documents for the Agent (as expected). I can add, delete, update Documents for an Agent. It does not matter whether the uniqueness or presence validation fails, the record is incorrectly added to the table and no error is reported. In the case of the empty name, the list of Documents has an entry that is totally blank and can not be selected for deletion or editing.
The attached tgz has an empty user table for your convenience. I have left in a few debug puts but they don't impact things very much.
Comments and changes to this ticket
-
Domizio Demichelis March 22nd, 2011 @ 12:59 PM
- State changed from new to open
- Milestone set to Hobo 1.3 (Rails 3)
- Assigned user set to Domizio Demichelis
- Milestone order changed from 197947 to 0
I tried your application. Since I have to test the bare hobo behaviour, I commented out all your stuff, and the invalid document record does not enter in the DB, so there is no bug with that respect (at least with the pre30 in the rails3 branch).
However, there is still the #477 and #489 bug that bites you when you have an invalid record. In hobo 1.3 the behaviour is that it shows an empty show-page for the invalid record, instead staying on the same page with the inline form, rerendering that form.
The problem is the buggy re_render_form that 1.3 inherits from the old hobo. We should refactory that part.
-
Domizio Demichelis March 27th, 2011 @ 02:13 AM
- State changed from open to hold
-
Domizio Demichelis April 15th, 2011 @ 05:09 PM
- State changed from hold to new
- Milestone changed from Hobo 1.3 (Rails 3) to Hobo 1.4
- Assigned user cleared.
- Milestone order changed from 53 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป