duke-libraries/ddr-models

View on GitHub
lib/ddr/datastreams/content_datastream.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Ddr::Datastreams
  class ContentDatastream < ExternalFileDatastream

    CONTENT_CHANGED = "content_changed.content.repo_file"

    around_save :notify_content_changed, if: [:external?, :dsLocation_changed?]

    private

    def notify_content_changed
      ActiveSupport::Notifications.instrument(CONTENT_CHANGED, pid: pid) do |payload|
        yield
      end
    end

  end
end