Files
nairobi/app/helpers/mailer_helper.rb
Javi Martín 735f99f877 Fix comment notifications on legislation proposals
The `commentable_url` method wasn't updated when we added legislation
proposals.

Back when we first created this method, we couldn't pass budget
investments or topics directly to `polymorphic_url` because they are
nested resources. That isn't the case since commit ff93f5a59, so now we
can simplify this method.

We're keeping the `commentable_url` method for now in order to keep
compatibility with custom changes that might use it, although this
method isn't consistent with the `commentable_path` method (which
receives a comment, and not a commentable), and so we might have to
revisit this code in the future.
2021-11-29 16:16:15 +01:00

19 lines
458 B
Ruby

module MailerHelper
def commentable_url(commentable)
polymorphic_url(commentable)
end
def valuation_comments_url(commentable)
admin_budget_budget_investment_url(commentable.budget, commentable, anchor: "comments")
end
def valuation_comments_link(commentable)
link_to(
commentable.title,
valuation_comments_url(@email.commentable),
target: :blank,
style: "color: #2895F1; text-decoration:none;"
)
end
end