-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Relate processes and scopes #1017
Conversation
a0e5ef2
to
975835b
Compare
Codecov Report
@@ Coverage Diff @@
## master #1017 +/- ##
==========================================
+ Coverage 97.16% 97.19% +0.02%
==========================================
Files 395 398 +3
Lines 6602 6663 +61
==========================================
+ Hits 6415 6476 +61
Misses 187 187
Continue to review full report at Codecov.
|
@mrcasals this also applies to projects (Budgets) |
@oriolgual thanks, description updated! |
@@ -0,0 +1,5 @@ | |||
class AddScopesToProcesses < ActiveRecord::Migration[5.0] | |||
def change | |||
add_column :decidim_participatory_processes, :scope_ids, :integer, array: true, default: [] |
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 is this an array?
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.
Because I hate HABTM, and we won't need to find the relation from the other end (eg scope.participatory_processes
).
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.
I did the same in SurveyResults in L'Hospitalet BTW
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.
But that shouldn't be a HABTM, it's a belong_to (from process to scope)
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.
@oriolgual didn't we agree to support multiple scopes for a process in the backend, but in fact only relate to one by now? I was sure we agreed to this, but I might have dreamt it :/
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.
LOL, I remember the conversation and I think I was against this. I think it's better to don't allow multiple scopes since this opens too many options.
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.
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.
No problem, it's an easy change
@@ -32,7 +32,7 @@ class ParticipatoryProcess < ApplicationRecord | |||
|
|||
has_many :features, foreign_key: "decidim_participatory_process_id" | |||
|
|||
attr_readonly :active_step |
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?
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.
I'm wondering too, actually
849edcc
to
2abea0b
Compare
@mrcasals, thanks for your PR! By analyzing the history of the files in this pull request, we identified @oriolgual and @beagleknight to be potential reviewers. |
f152b35
to
b278c39
Compare
@@ -46,6 +46,8 @@ def create_participatory_process | |||
hero_image: form.hero_image, | |||
banner_image: form.banner_image, | |||
promoted: form.promoted, | |||
meta_scope: form.meta_scope, |
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.
You should rename the keys at the locales files
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.
Oh, true
@@ -58,7 +58,7 @@ | |||
banner_image { test_file("city2.jpeg", "image/jpeg") } | |||
published_at { Time.current } | |||
organization | |||
scope { Decidim::Faker::Localized.word } | |||
meta_scope { Decidim::Faker::Localized.word } |
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.
Shouldn't we add the scope too? Or a trait
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.
A trait it is.
🎩 What? Why?
Relate processes and scopes, and revert part of the changes done for #835.
📌 Related Issues
📋 Subtasks