Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord/base.rb

Class Method Summary collapse

Class Method Details

.get_unique_index_columnsObject



5
6
7
# File 'lib/activerecord/base.rb', line 5

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