Sha256: cdfbc6d723be7af45edee8901c54fb4c6e6acf55984214e0429dd8c7e8f4e530

Contents?: true

Size: 757 Bytes

Versions: 4

Compression:

Stored size: 757 Bytes

Contents

module ActsAsArchive
  module Base
    module Adapters
      module MySQL
        
        private

        def archive_table_indexed_columns
          index_query = "SHOW INDEX FROM archived_#{table_name}"
          indexes = connection.select_all(index_query)
          final_indexes = []
          current_index = 0
          indexes.each do |index|
            if index['Seq_in_index'] != '1'
              final_indexes[current_index-1] = Array(final_indexes[current_index-1]).flatten.concat(Array(index['Column_name']).to_sym)
            else
              final_indexes[current_index] = index['Column_name'].to_sym
              current_index += 1
            end
          end
          return final_indexes
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gravis-acts_as_archive-0.2.10 lib/acts_as_archive/base/adapters/mysql.rb
gravis-acts_as_archive-0.2.7 lib/acts_as_archive/base/adapters/mysql.rb
gravis-acts_as_archive-0.2.9 lib/acts_as_archive/base/adapters/mysql.rb
gravis-acts_as_archive-0.2.8 lib/acts_as_archive/base/adapters/mysql.rb