Commit daaae4a
committed
Ensure Arbre context is reset
When you have an Arbre component with a block form, it pushes the current
node onto a stack so that it can use [method_missing][1] to provide a dynamic
evaluation context (eg. so tab is available only directly inside of tabs).
Unfortunately, when an error is raised inside inside one of these, if we
have a rescue to catch that error so the rest of the page can be rendered -
the context is still stuck inside the last block that was added. Other than
likely rendering some of the wrong markup (depending on usage), it means
the context is not put back into the block where the rescue is located.
As a result, even though that block is effectively thrown away when a
rescue is located above the erroring call, certain features are not available.
[1]: https://github.com/activeadmin/arbre/blob/v2.2.0/lib/arbre/element.rb#L176-L1861 parent 310e64b commit daaae4a
2 files changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
35 | 61 | | |
0 commit comments