# Class UsersProjectObserver < ActiveRecord::Observer

- app/observers/users_project_observer.rb

Methods

A
  - after_commit,
  - after_create,
  - after_destroy

Instance Public methods
after_commit(users_project) Link

Source: show

    # File app/observers/users_project_observer.rb, line 2
    def after_commit(users_project)
      return if users_project.destroyed?
      Notify.project_access_granted_email(users_project.id).deliver
    end

after_create(users_project) Link

Source: show

    # File app/observers/users_project_observer.rb, line 7
    def after_create(users_project)
      Event.create(
        project_id: users_project.project.id,
        action: Event::Joined,
        author_id: users_project.user.id
      )
    end

after_destroy(users_project) Link

Source: show

    # File app/observers/users_project_observer.rb, line 15
    def after_destroy(users_project)
      Event.create(
        project_id: users_project.project.id,
        action: Event::Left,
        author_id: users_project.user.id
      )
    end