24pullrequests/24pullrequests — pull request #830 by wadtech (2014-12-15 16:21:36+00:00)
Title: adds passing spec for model validation of unique pull requests in new gift

one half of #823

I'm not at all sure how to tackle the migration part, is it safe to do something like:

```ruby

class SetGiftIndexAsUnique < ActiveRecord::Migration
def change
remove_index :gifts, [:user_id, :pull_request_id]
add_index :gifts, [:user_id, :pull_request_id], unique: true
end
end

```

Or will that lose a bunch of other useful information on the existing index?