recourse 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +7 -2
- data/app/controllers/recourse/base_controller.rb +1 -1
- data/app/controllers/recourses_controller.rb +1 -1
- data/lib/recourse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7de35fdbec1f8879c4fb6636bf023bd6ed9e585b3d63fc95c0d76c4f0c36fa49
|
|
4
|
+
data.tar.gz: 5e3a1779c3153d4089d2039f074525986963bbc77a5ff6827995dffed74565cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62dcf7cd0da6acb1af4925cebdc9b9186cd28984d19979acfdbaae7642c697bb77ace967cf1fe247dc3220e187f54d45c5ee80a199880d90041788d2f14d8c1b
|
|
7
|
+
data.tar.gz: dda6c4c65b5d3e72b56bdea47101f979d5d9f6a0c0452b53b5e1d655431d2cf4f238149b20bdd0b6dac9b000bc600d5474a4cfa8b7ac32ac01ae5e57bd55816c
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## 8.0.1 - 2026-10-14
|
|
11
|
+
|
|
12
|
+
* [FIX] Guard the screens with `prepend_before_action`, not `before_action`
|
|
13
|
+
|
|
14
|
+
Since 8.0.0 a record's pages look it up through `recourse_relation` before any
|
|
15
|
+
`before_action` of the host's runs, so a relation reading who is signed in -- an admin's
|
|
16
|
+
own chats -- found nobody and raised. The README, the guides and the comments now say
|
|
17
|
+
`prepend_before_action :authenticate!`, which runs the guard first.
|
|
18
|
+
|
|
10
19
|
## 8.0.0 - 2026-10-14
|
|
11
20
|
|
|
12
21
|
* [BREAKING] A record's own pages find it among the rows `recourse_relation` lists
|
data/README.md
CHANGED
|
@@ -168,13 +168,18 @@ which the host defines to put behavior above every screen at once:
|
|
|
168
168
|
|
|
169
169
|
```ruby
|
|
170
170
|
class RecoursesController < Recourse::BaseController
|
|
171
|
-
|
|
171
|
+
prepend_before_action :authenticate!
|
|
172
172
|
end
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
`prepend_before_action`, so the guard runs before the gem's own: a record's pages look
|
|
176
|
+
it up through `recourse_relation`, and a relation that reads who is signed in finds
|
|
177
|
+
nobody yet if the guard comes after.
|
|
178
|
+
|
|
175
179
|
A controller the app already defines is left alone, and one line of it is usually
|
|
176
180
|
enough: `recourse_relation` puts a scope of your own behind a table the gem draws
|
|
177
|
-
whole, and behind the pages of each record in it, and `find_resource` finds a singular
|
|
181
|
+
whole, and behind the pages of each record in it, and `find_resource` finds a singular
|
|
182
|
+
record the parent names no association for.
|
|
178
183
|
|
|
179
184
|
## Step 5. Enjoy the extras
|
|
180
185
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Recourse
|
|
2
2
|
# Everything a recoursed screen does, in a class of its own so a host can put
|
|
3
3
|
# its own behavior above it — `class RecoursesController < Recourse::BaseController`
|
|
4
|
-
# with a `
|
|
4
|
+
# with a `prepend_before_action :authenticate!` guards every screen the gem serves.
|
|
5
5
|
class BaseController < ApplicationController
|
|
6
6
|
include Pagy::Method, Positioned, AttachmentResolution, AttachmentWriting,
|
|
7
7
|
Landing, Paging, ListResolution, ParameterResolution, ParentNaming,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The superclass every recoursed controller gets, and what puts its templates
|
|
2
2
|
# under `recourses/`. A host defines this class itself — its `app/controllers`
|
|
3
|
-
# comes first — to put a `
|
|
3
|
+
# comes first — to put a `prepend_before_action` of its own above every screen.
|
|
4
4
|
class RecoursesController < Recourse::BaseController
|
|
5
5
|
# Empty on purpose: the behavior is the base class, so a host redefining this
|
|
6
6
|
# one loses none of it.
|
data/lib/recourse/version.rb
CHANGED