Conversation
| scopes_enabled: form.scopes_enabled, | ||
| scope: form.scope, | ||
| area: form.area, | ||
| parent_id: form.parent_id, |
There was a problem hiding this comment.
You'll need to modify the Decidim::Assemblies::AdminLog::AssemblyPresenter to reflect this attribute
There was a problem hiding this comment.
Can you use the object instead of the id? (parent: form.parent)
Codecov Report
@@ Coverage Diff @@
## master #2938 +/- ##
=========================================
+ Coverage 98.59% 98.6% +<.01%
=========================================
Files 1716 1718 +2
Lines 40967 41105 +138
=========================================
+ Hits 40393 40530 +137
- Misses 574 575 +1 |
a480143 to
41c0ff9
Compare
|
@decidim/lot-core ready to review! |
|
@rbngzlv some conflicts arose! 😄 |
| slug | ||
| end | ||
|
|
||
| def ancestors |
There was a problem hiding this comment.
Should we save these ancestors as an array of IDs in the DB, so we can speed up the relation? If we save an array, then we can do Assembly.where(id: ancestor_ids) and we can return them all at once instead of querying them one by one
c99284f to
bcd1bcb
Compare
| <div class="card-divider"> | ||
| <h2 class="card-title"> | ||
| <%= t "decidim.admin.titles.assemblies" %><%= link_to t("actions.new", scope: "decidim.admin", name: t("models.assembly.name", scope: "decidim.admin")), ["new", "assembly"], class: "button tiny button--title" if can? :create, Decidim::Assembly %> | ||
| <%= link_to "#{translated_attribute(parent_assembly.title)} > ", edit_assembly_path(parent_assembly) if parent_assembly %> |
There was a problem hiding this comment.
Are we only having 1 level of parent-child? If we're having multiple levels of parents, then this should reflect all the ancestors, I guess?
| private | ||
|
|
||
| # rubocop:disable Rails/SkipsModelValidations | ||
| def set_parents_path |
There was a problem hiding this comment.
@rbngzlv can you explain the paths concept? I don't understand it
There was a problem hiding this comment.
@oriolgual @mrcasals asked me to have the parent_ids cached in a column, so we can render the breadcumbs faster without a 1+N query. I have implemented it using the ltree extension of PostgreSQL.
This allow us to update all descendants (child of child, ...) of an assembly in a single query when their parent changes and also to save the "path" for the actual record only querying their direct parent.
You can check this blog post for more information: http://patshaughnessy.net/2017/12/13/saving-a-tree-in-postgres-using-ltree
There was a problem hiding this comment.
Maybe it would be nice to add some docs explaining this then, since it's not quite common.
|
|
||
| class EnableLtreeExtension < ActiveRecord::Migration[5.0] | ||
| def change | ||
| enable_extension "ltree" |
There was a problem hiding this comment.
Should we merge these migrations?
| scopes_enabled: form.scopes_enabled, | ||
| scope: form.scope, | ||
| area: form.area, | ||
| parent_id: form.parent_id, |
There was a problem hiding this comment.
Can you use the object instead of the id? (parent: form.parent)
| scopes_enabled: form.scopes_enabled, | ||
| scope: form.scope, | ||
| area: form.area, | ||
| parent_id: form.parent_id, |
There was a problem hiding this comment.
The same as create, use the object instead of the id.
* master: [RFC] Use cells for meeting m cards (#3022) Do not force Postgresql user to be admin when enabling trigram extension (#3053) Make organization reference_prefix required (#3056) admin can duplicate/copy meetings (#3051) Fix question form errors not being displayed (#3046) Erb whitespace cutting (#3047) Show debates statistics on space show and homepage (#3016) Fix broken translated field after form errors (#3026) Move decidim executable to "exe" folder (#3028) Friendlier buttons (#3027) Feedback needed after Endorsing when user has no user_groups (#2998) Fix seeding error on generator specs (#3021) fix spelling error in threshold (#3019) Migration plus seeds (#2933)
39422c9 to
31f05ec
Compare
|
@mrcasals @oriolgual I think that all requested changes are done! |
|
@decidim/lot-core can you review it, please? |
🎩 What? Why?
It must be possible for an assembly to have children
📌 Related Issues
📋 Subtasks
CHANGELOGentry