User Subscriptions feature starting point #171
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connects to #166.
What does this PR do?
This PR introduces a new feature which allows any signed in User to subscribe to determined system resources in both generic and specific contexts. To do that, we're adding a new model called
User::Subscription
to the system and a simple interface to access it.It also allows any not signed in User to subscribe to those exposed resources by starting a new User registration process with the pre-created
User::Subscription
item.Extra 馃幈
ActiveRecord
models itself.How should this be manually tested?
As an integration sample, the
GobiertoBudgetConsultations::Consultation
model has been set up as a the only "subscribable" resource for now, so these are the available user interactions:A. When signed in as a User
The subscription box should be shown as follows:
Generic context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/
Specific context URL:
http:https://madrid.gobierto.dev/consultas_presupuestos/<consultation_id>
B. When not signed in
The subscription box should be shown as follows:
Generic context URL: http:https://madrid.gobierto.dev/consultas_presupuestos/
Specific context URL:
http:https://madrid.gobierto.dev/consultas_presupuestos/<consultation_id>
鉁忥笍 Known improvements
Finally, I'm keeping some known improvements here for future iterations: