aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/attached/changes/create_one_of_many.rb
blob: 7268e873162c4d96c3dce4734f1760991a2d11d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

module ActiveStorage
  class Attached::Changes::CreateOneOfMany < Attached::Changes::CreateOne #:nodoc:
    private
      def find_attachment
        record.public_send("#{name}_attachments").detect { |attachment| attachment.blob_id == blob.id }
      end
  end
end