RubyGems.org

With more than one application server, validates_uniqueness_of becomes a lie. Two app servers -> two requests -> two near-simultaneous uniqueness checks -> two processes that commit to the database independently, violating this faux constraint. You'll need a database-level constraint for cases like these. consistency_fail will find your missing unique indexes, so you can add them and stop ignoring the C in ACID.

installgem install consistency_fail
Authors

Colin Jones

18,176 total downloads 6,138 for this version
Owners

E16bc9c356b65d61ee1d74c8f06ae35b

Licenses

MIT

Gemfile
gem 'consistency_fail', '~> 0.3.2'
Versions
  1. 0.3.2 July 23, 2013 (11.5 KB)
  2. 0.3.1 July 18, 2013 (11.5 KB)
  3. 0.3.0 January 18, 2013 (11 KB)
  4. 0.2.2 January 4, 2012 (10.5 KB)
  5. 0.2.1 June 17, 2011 (11 KB)
Show all versions (8 total)
Development Dependencies
  1. activerecord ~> 3.0
  2. rspec >= 0