Sha256: 464f1ed0a61c88ae3a0fb5b379b1eb7955fdd344c966d83987401305bec8cf2f
Contents?: true
Size: 336 Bytes
Versions: 25
Compression:
Stored size: 336 Bytes
Contents
class AddIndexForPath < ActiveRecord::Migration def self.up shares = Gitdocs::Configuration::Share.all.inject(Hash.new{|h,k| h[k] = []}) {|h, s| h[s.path] << s; h} shares.each do |path, shares| shares.shift shares.each(&:destroy) unless shares.empty? end add_index :shares, :path, :unique => true end end
Version data entries
25 entries across 25 versions & 2 rubygems