Skip to content

Custom Columns for Noticed::Event and Noticed::Notification #517

Answered by excid3
t2 asked this question in Q&A
Discussion options

You must be logged in to vote

with assigns attributes using new in ActiveRecord but it assigns them to params.

def with(params)
if self < Ephemeral
new(params: params)
else
record = params.delete(:record)
new(params: params, record: record)
end
end

I imagine this will work:

notifier = Groups::NewMessageNotifier.with(
  message:,
  mentioned:,
  record: group,
  account: group.account
)
notifier.account = group.account
notifier.deliver(member)

Also just using new directly:

Groups::NewMessageNotifier.new(
  params: {
    message:,
    mentioned:,
  },
  record: group,
  account: group.account
).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@t2
Comment options

Answer selected by t2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants