activerecord-rescue_from_duplicate 0.0.5 → 0.0.6

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: b3a479292da8350de483da5bbb0afee3a47ba4b4
4
- data.tar.gz: 2b8c76a863efde4bd0185b1d5640fd1ce9985f0d
3
+ metadata.gz: 177b4e3d186607ace00720b9a9aa0ef36c4544ba
4
+ data.tar.gz: d1572e760fa9e8db750096b2ccf0ff8ce8103951
5
5
  SHA512:
6
- metadata.gz: b9d56a6e3ab8b7e6941c99a654cd2b8ca7df38b11016428b0b499591f23c3b92aa0cc32c19bec0bbee2cab135062ff50abb497f7a64f37a201534a7976c0933b
7
- data.tar.gz: 86a93932d8a5a7806a5f6cbdf54d1a79a212496abbfe874fa1f3e995db0e7ff3c623d18c2cc48d7c054c69baf5e7bb6e21bc59a85422ced656185eaa085c7a76
6
+ metadata.gz: 917489d657451b3efe18181ebcdae646f6b392952f0ee0616b800fa04741b739840d73cd7feb80529df0b077926efadb96f8454602d0d58a2efef1129b4de55f
7
+ data.tar.gz: 4f8ed33d63076f70e383069c9b97277d5d2efe315afc92f31c96ff63e209eb3d082d5127409221f810b810312b22a221fdbd803a32500a95f29f764d3b05cd0b
@@ -1,5 +1,5 @@
1
1
  module Activerecord
2
2
  module RescueFromDuplicate
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ module RescueFromDuplicate
4
4
 
5
5
  def initialize(attribute, options)
6
6
  @attributes = [attribute]
7
- @columns = [attribute, *Array(options[:scope])].map(&:to_s)
7
+ @columns = [attribute, *Array(options[:scope])].map(&:to_s).sort
8
8
  @options = options
9
9
  end
10
10
 
data/spec/rescuer_spec.rb CHANGED
@@ -1,11 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe RescueFromDuplicate::Rescuer do
4
- subject { RescueFromDuplicate::Rescuer.new(:name, scope: :shop_id) }
4
+ subject { RescueFromDuplicate::Rescuer.new(:shop_id, scope: :name) }
5
5
 
6
6
  context "#matches?" do
7
7
  it 'is true when the columns are the same' do
8
8
  expect(subject.matches?(["shop_id", "name"])).to be true
9
+ expect(subject.matches?(["name", "shop_id"])).to be true
9
10
  end
10
11
 
11
12
  it 'is false when the columns are not the same' do
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.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Malette
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-24 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord