validates_duplicity_of 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9ca17376355188c72f408f519d8dfb9eb1050bd
4
- data.tar.gz: 3a898d1fc183f1d076c6513b1884ee37f51d0aba
3
+ metadata.gz: a62efc288d0719897a9a875a1c464882ab0c0a5d
4
+ data.tar.gz: 264e116e4d28ca77bce066868ecffa9ac370db83
5
5
  SHA512:
6
- metadata.gz: 38f7571c6b2e4780c996952ed894c9c6921a84ac2a95c600c54f1f8b700c072338cc40b8fbb1016af5f6a776cfcb0ca3badcee15196b2ecb188b11389856611e
7
- data.tar.gz: 6633e52514694cd093e970a0e50bd3b8113e1745fef0f4fe3e49076260b82d009ff08c0230331795cac3a2815ca5052ae898d879921fc0c2e3b15721ccce6413
6
+ metadata.gz: 3e862f626d78304631e9a141f6519b11bb2d65d0ddd2960695f05f3ff53c972cdaeabaca485fb4fd05deff9fc663badf939c05b6677ed1b2d5b2d14f444c3abd
7
+ data.tar.gz: d4b51fe409ca2b10d1e25b9e37166350ab53980f30b9018ef5c27395dea10287a339c18aedf983b4b0c0ecc8c3fe417500c5237813ffa038d1f450fdc8e353a2
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �f����t�c�N�m
2
- aVW0_���{�>��|~.LAT���ơ�AQ
1
+ � ૩N��y\�@[Ǖ���"rͯ��ג���E*�ַ
2
+ �{���74�#�~���"�~ )?Q$�n����T �����؎��H�ǔk�ÐM�/9����H�b2|U+A��twЗ������vl�X��c��d- 2�S0�x9M}:�X���d�F�)�p0[P��z3�g�%Q�7p���_'j�Y�e�v�ꂳ��(^��?yn/��^��6����K��GI�b@�Оρ����F�'?7�l�)<
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # validates_duplicity_of
2
2
 
3
- ActiveRecord (>= 3) callback which handle the name duplication in your model with ease.
3
+ ActiveRecord (>= 3.2) callback which handle the name duplication in your model with ease.
4
4
  Ruby 2 only!
5
5
 
6
- **Example :**
6
+ **Example:**
7
7
 
8
- Untilted File > Untilted File (1) > Untilted File (2) …
8
+ Untitled File > Untitled File (1) > Untitled File (2) …
9
9
 
10
10
  ## Installation
11
11
 
@@ -23,7 +23,7 @@ Or install it yourself as:
23
23
 
24
24
  Or with security:
25
25
 
26
- $ wget https://gist.github.com/madwork/7026195/raw/6e06ae0754eecdf78cbb091e816597e860022dc1/gem-public_cert.pem -O madwork-public_cert.pem
26
+ $ wget http://git.io/hHL6zQ -O madwork-public_cert.pem
27
27
  $ gem cert --add madwork-public_cert.pem
28
28
  $ gem install validates_duplicity_of --trust-policy=HighSecurity
29
29
 
@@ -34,21 +34,20 @@ Use method `validates_duplicity_of` with attribute in your Rails model. Scope is
34
34
  class Post < ActiveRecord::Base
35
35
  validates_duplicity_of :name, scope: :user_id
36
36
  end
37
-
37
+
38
38
  p = Post.create name: "Foo", user_id: 1
39
39
  p.name
40
40
  => "Foo"
41
-
41
+
42
42
  p = Post.create name: "Foo", user_id: 1
43
43
  p.name
44
44
  => "Foo (1)"
45
-
45
+
46
46
  class Note < ActiveRecord::Base
47
47
  validates_uniqueness_of :name
48
48
  validates_duplicity_of :name, callback: :before_validation
49
49
  end
50
50
 
51
-
52
51
  ## Contributing
53
52
 
54
53
  1. Fork it
@@ -1,3 +1,3 @@
1
1
  module ValidatesDuplicityOf
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -18,8 +18,8 @@ module ValidatesDuplicityOf
18
18
  end
19
19
  end
20
20
  end
21
- send callback, &validates
21
+ set_callback *callback.to_s.split('_').reverse.map(&:to_sym), &validates # default: set_callback :save, :before, &validates
22
22
  end
23
23
  end
24
24
 
25
- ActiveRecord::Base.extend ValidatesDuplicityOf
25
+ ActiveRecord::Base.extend ValidatesDuplicityOf
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec", ">= 2.3"
24
24
  spec.add_development_dependency "sqlite3-ruby"
25
-
26
- spec.add_dependency "activerecord", ">= 3.0"
25
+
26
+ spec.add_dependency "activerecord", ">= 3.2"
27
27
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_duplicity_of
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Durand
@@ -31,7 +31,7 @@ cert_chain:
31
31
  xDr7hfCTJQsNosd7V5q7Uz+SYPK9ALyONt5t3KKYEWS/mBCStEuQXwjIsWG/bqwr
32
32
  vqfQstIS
33
33
  -----END CERTIFICATE-----
34
- date: 2013-10-18 00:00:00.000000000 Z
34
+ date: 2013-11-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
@@ -95,14 +95,14 @@ dependencies:
95
95
  requirements:
96
96
  - - '>='
97
97
  - !ruby/object:Gem::Version
98
- version: '3.0'
98
+ version: '3.2'
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '>='
104
104
  - !ruby/object:Gem::Version
105
- version: '3.0'
105
+ version: '3.2'
106
106
  description: ActiveRecord callback which handle the name duplication in your model.
107
107
  email:
108
108
  - vincent.durand@madwork.org
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.1.7
145
+ rubygems_version: 2.1.11
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: ActiveRecord callback which handle the name duplication in your model with
@@ -152,4 +152,3 @@ test_files:
152
152
  - spec/spec_helper.rb
153
153
  - spec/support/models.rb
154
154
  - spec/support/schema.rb
155
- has_rdoc:
metadata.gz.sig CHANGED
Binary file