Commit 028e905
committed
Add Entity.[] for Grape >= 3.2 param type compatibility
Grape 3.2 requires all param types to respond to [] for coercion.
Entity classes used as param types (e.g. `type: UserEntity`) crash
at route definition time because Grape::DryTypes checks
respond_to?(:[]) and raises ArgumentError when it is missing.
Add a pass-through [] class method that satisfies the check without
altering any existing behavior.1 parent 99c2ffe commit 028e905
2 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1013 | 1029 | | |
1014 | 1030 | | |
1015 | 1031 | | |
| |||
0 commit comments