From b3785b33e8efd3a4d19b57509861a60eed7c49b7 Mon Sep 17 00:00:00 2001 From: Darcy Laycock Date: Wed, 20 May 2015 18:21:37 +1000 Subject: [PATCH] Record not unique fixes. --- Gemfile | 2 +- spec/integration/active_record_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index d719276..93bfc47 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,6 @@ if (wp_version = ENV['WILL_PAGINATE_VERSION']) gem 'will_paginate', wp_version end -gem 'active_model_serializers' +gem 'active_model_serializers', ENV['AMS_VERSION'] || '> 0.0' gemspec diff --git a/spec/integration/active_record_spec.rb b/spec/integration/active_record_spec.rb index d56a8b8..09dae29 100644 --- a/spec/integration/active_record_spec.rb +++ b/spec/integration/active_record_spec.rb @@ -42,7 +42,8 @@ end end - pending 'should automatically map ActiveRecord::RecordNotUnique' do + it 'should automatically map ActiveRecord::RecordNotUnique' do + Fish.connection.add_index :fish, :latin_name, unique: true attrs = {:token => "a", :name => "Test Fish", :latin_name => "Latin Name", :child_number => 5} Fish.create! attrs action_is { Fish.create!(attrs); raise "This should not happen..." }