noticed icon indicating copy to clipboard operation
noticed copied to clipboard

Generator for ApplicationNotification base class

Open rafaelpivato opened this issue 4 years ago • 1 comments

Create a generator noticed:application_notification to create a base class for notifications of a Rails application.

class ApplicationNotification < Noticed::Base
  def database_format
    {
      'type': self.class.name,
      'params': params
    }
  end

  def action_format
    params
  end
end

It would be good if noticed:notification could be modified to inherit from this ApplicationNotification whenever it exists. On the other hand, a warning could also be emitted if you have notifications already created in order to update their super class.

rafaelpivato avatar Feb 21 '21 19:02 rafaelpivato

Definitely like this idea. I had manually added an ApplicationNotification to JumpstartRails.com and it would be great ot have built-in.

excid3 avatar Mar 26 '21 20:03 excid3