method

create_or_find_record

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: VariantWithRecord
create_or_find_record(image:) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activestorage/app/models/active_storage/variant_with_record.rb, line 56
    def create_or_find_record(image))
      @record =
        ActiveRecord::Base.connected_to(role: ActiveRecord.writing_role) do
          blob.variant_records.create_or_find_by!(variation_digest: variation.digest) do |record|
            record.image.attach(image)
          end
        end
    end
Register or log in to add new notes.