openproject-proto_plugin icon indicating copy to clipboard operation
openproject-proto_plugin copied to clipboard

notify_changed_kittens

Open kgish opened this issue 8 years ago • 0 comments

In the kittens controller, there is an opportunity to use notifications and document how it works.

def create
    @kitten = Kitten.new(kitten_params)
    if @kitten.save
      notify_changed_kittens(:created, @kitten)
      ...
    end
  end

  private

  def notify_changed_kittens(action, changed_kitten)
    OpenProject::Notifications.send(:kittens_changed, action: action, kitten: changed_kitten)
  end

kgish avatar Mar 13 '17 20:03 kgish