Skip to content

Commit

Permalink
overwrite attributes method to exclude recipients_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
mortbauer committed May 25, 2024
1 parent 971e20c commit 5ae30de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/messages/app/models/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class Message < ApplicationRecord

has_rich_text :body

# Override the `attributes=` method to exclude `recipients_ids`
def attributes=(new_attributes)
new_attributes = new_attributes.reject { |key, _| key.to_sym == :recipients_ids }
super(new_attributes)
end

after_initialize do
@recipients_ids ||= []
@send_method ||= 'recipients'
Expand Down

0 comments on commit 5ae30de

Please sign in to comment.