class Midnight::Rails::CommitHooker

after_commit hook dev.to/evilmartians/rails-aftercommit-everywhere–4j9g

Attributes

after_commit[R]

:nocov:

Public Class Methods

new(&after_commit) click to toggle source
# File lib/midnight/rails/commit_hooker.rb, line 6
def initialize(&after_commit)
  @after_commit = after_commit
  freeze
end

Public Instance Methods

method_missing(method_name, *_args) click to toggle source

:nocov: rubocop:disable Style/MethodMissingSuper

# File lib/midnight/rails/commit_hooker.rb, line 13
def method_missing(method_name, *_args)
  after_commit.call if method_name == :committed!
end
respond_to_missing?(_method_name, _include_private = false) click to toggle source

rubocop:enable Style/MethodMissingSuper

# File lib/midnight/rails/commit_hooker.rb, line 18
def respond_to_missing?(_method_name, _include_private = false)
  true
end