-
Notifications
You must be signed in to change notification settings - Fork 899
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
Made changes to instance add/edit code to remove AR Objects from @edit #139
Made changes to instance add/edit code to remove AR Objects from @edit #139
Conversation
@@ -840,7 +842,7 @@ def update_instance | |||
@in_a_form = false | |||
replace_right_cell | |||
when "save" | |||
if @edit[:new][:ae_inst].name.blank? || @edit[:new][:ae_inst].name == "" | |||
if @edit[:new][:ae_inst]["name"].blank? || @edit[:new][:ae_inst]["name"] == "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check for == ""
if code is already checking for .blank?
?
- Changed code to add/edit Instance to not store AR Objects in @edit instead store required fields into array of hashes. Made some minor cleanup along the way to methods edited in this commit. - Changed view to use hashes to access data instead of AR Object. https://bugzilla.redhat.com/show_bug.cgi?id=1114747 https://bugzilla.redhat.com/show_bug.cgi?id=1115652
@chessbyte made suggested changes. |
Removed code duplication from initial_setup_for_instances_form_vars method. https://bugzilla.redhat.com/show_bug.cgi?id=1114747 https://bugzilla.redhat.com/show_bug.cgi?id=1115652
@h-kataria Getting this when I press Save after making some changes to an instance: |
Added a missing header column "On Error" in Instance grid, that was causing grid to display incorrect data in rows. https://bugzilla.redhat.com/show_bug.cgi?id=1114747 https://bugzilla.redhat.com/show_bug.cgi?id=1115652
Checked commits h-kataria@5df1781 .. h-kataria@bc641b3 with rubocop 0.21.0 |
Do we need variable called |
@martinpovolny We have used the @temp instance var to hold values needed by the views, but that don't need to be stateful (i.e. needed after the current transaction), knowing it will be thrown away at the end of the transaction. Should we have something more specific? Perhaps on a case by case basis, but generally I don't think so due to the next answer. Refactor to remove instance vars from the views? Yes, we should do this ongoing, perhaps some of the more resource intensive, data providing, values could be created in helper methods so the controller can build the values, but the views can call the helper methods to fetch a cached value when needed. Open to other suggestions as well. |
Tested automate explorer and verified session object never goes higher than 20K. |
…tance_editor Made changes to instance add/edit code to remove AR Objects from @edit
@dclarizio : yes, I would prefer something more specific basically in all cases. If we need an instance variable I would call it for example Later this is sooo much easier to refactor, if you see just the corresponding occurrences when you |
https://bugzilla.redhat.com/show_bug.cgi?id=1114747
https://bugzilla.redhat.com/show_bug.cgi?id=1115652
@dclarizio please review/test.