method

find_unique_index_for

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: InsertAll
find_unique_index_for(unique_by) private

No documentation

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

Hide source
# File activerecord/lib/active_record/insert_all.rb, line 59
      def find_unique_index_for(unique_by)
        match = Array(unique_by).map(&:to_s)

        if index = unique_indexes.find { |i| match.include?(i.name) || i.columns == match }
          index
        else
          raise ArgumentError, "No unique index found for #{unique_by}"
        end
      end
Register or log in to add new notes.