Sha256: 6b0a530cac5a6c5003403329bee01fb8715d050a9d29f28c1a3fc8ff41814c7c

Contents?: true

Size: 413 Bytes

Versions: 8

Compression:

Stored size: 413 Bytes

Contents

# frozen_string_literal: true

module CableReady
  module Updatable
    class CollectionUpdatableCallbacks
      def initialize(operation)
        @operation = operation
      end

      def after_commit(model)
        update_collections(model)
      end

      private

      def update_collections(model)
        model.class.cable_ready_collections.broadcast_for!(model, @operation)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cable_ready-5.0.6 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.3 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.2 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.1 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.0 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.0.rc2 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.0.rc1 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb
cable_ready-5.0.0.pre10 app/models/concerns/cable_ready/updatable/collection_updatable_callbacks.rb