Skip to content

Commit

Permalink
🐛 (component) Fix: authorship joining on proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien Froger committed Dec 14, 2024
1 parent f553ca0 commit f1908f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.resources_for(component, act_as)
if act_as.nil?
resources.published
else
resources.published.or(resources.where(published_at: nil, decidim_user_id: act_as.id))
resources.published.or(resources.where(published_at: nil, decidim_author_id: act_as.id))
end
end
has_many :resources, meta: (proc do |component, params|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ def self.resources_for(component, act_as)
if act_as.nil?
resources.published
else
resources.published.or(resources.where(published_at: nil, decidim_user_id: act_as.id))
resources.published.or(
resources.joins(:coauthorships).where(
published_at: nil,
coauthorships: { decidim_author_id: act_as.id }
)
)
end
end

Expand Down

0 comments on commit f1908f0

Please sign in to comment.