activerecord-rescue_from_duplicate 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99a2e09bb6ac6774ef2e6e452cc1be0a1db87799
4
- data.tar.gz: 1ae17a3c73dde0a7aa54c13f86d2a6d3b140c7f1
3
+ metadata.gz: 99e556184dcd2af6057a37ec28413793958ecda0
4
+ data.tar.gz: 51098dffb2d6b8d5b89b28f2f2664be4e4e34202
5
5
  SHA512:
6
- metadata.gz: 2d49bfe997a680e977e134344045aaf453afaf5da46a437522140e0dd50a3c5eb0ec72e6bcb03ceb6a8ee57136509abb7cde77daa8e9f0c4d8a94cfd3810f521
7
- data.tar.gz: 4686cbe3e99568fb77f75bd6cede972053a49ad4b1cb64520a64ee4d793f3754921ee1e89d64ea3a33fc1ed524731aa836bf4e8d931ea3686a64741daf89b957
6
+ metadata.gz: acaaf4ae2919df995ac930b8ea2bdefb400753fc18b3883c717bc8e204cf9c0d681c515cc20a9c04f0b8ba5f3c2ab7b09610d1c4e005a17cee0d0312c0d6937f
7
+ data.tar.gz: 423538cdfdfa906a50b17beeb2e697dcd7cc38cc23683a3c2b2092cf8c4b29a10d0b14f12e8be42bcbce5284cd74dd3eceee131df0db4f48b4d0b6e8a1fde9a4
@@ -1,8 +1,8 @@
1
1
  sudo: false
2
2
  rvm:
3
- - 2.0
4
3
  - 2.1
5
4
  - 2.2
5
+ - 2.3.1
6
6
  gemfile:
7
7
  - gemfiles/Gemfile.ar-3.2
8
8
  - gemfiles/Gemfile.ar-4.0
data/README.md CHANGED
@@ -10,7 +10,7 @@ Additionally, a macro allows you to assume that the record will be unique and re
10
10
 
11
11
  Tested with:
12
12
 
13
- - ActiveRecord: 3.2, 4.0, 4.1, edge
13
+ - ActiveRecord: 3.2, 4.0, 4.1, 4.2, edge
14
14
  - Ruby 1.9.3, 2.0.0, 2.1.2
15
15
  - MySQL, PostgreSQL, Sqlite3
16
16
 
@@ -7,8 +7,7 @@ module RescueFromDuplicate
7
7
  end
8
8
 
9
9
  def self.missing_unique_indexes
10
- ar_subclasses = ObjectSpace.each_object(Class).select{ |klass| klass < ::ActiveRecord::Base }
11
- klasses = ar_subclasses.select do |klass|
10
+ klasses = ::ActiveRecord::Base.descendants.select do |klass|
12
11
  klass.validators.any? { |v| v.is_a?(::ActiveRecord::Validations::UniquenessValidator) || klass._rescue_from_duplicates.any? }
13
12
  end
14
13
 
@@ -1,5 +1,5 @@
1
1
  module Activerecord
2
2
  module RescueFromDuplicate
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-rescue_from_duplicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Malette
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord