Sha256: 51cec4e6bb8ec10940b77c9d5f77d8f9b0b37f258fc453b91b116dd6df3b92f2
Contents?: true
Size: 353 Bytes
Versions: 6
Compression:
Stored size: 353 Bytes
Contents
#TODO: Use :dependent for FK cascade? module ActiveRecord class Base class << self public def get_unique_index_columns self.connection.indexes(self.table_name, "#{self.name} Indexes").select { |index| index.unique && index.columns.size == 1 }.map{ |index| index.columns.first } end end end end
Version data entries
6 entries across 6 versions & 3 rubygems