Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify_changed_kittens #12

Open
kgish opened this issue Mar 13, 2017 · 0 comments
Open

notify_changed_kittens #12

kgish opened this issue Mar 13, 2017 · 0 comments

Comments

@kgish
Copy link
Contributor

kgish commented Mar 13, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant