validator_attachment 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/README.rdoc +10 -10
- data/validator_attachment.gemspec +3 -3
- metadata +5 -5
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -58,7 +58,7 @@ You can test this as follows:
|
|
58
58
|
assert ActiveModel::Validations::PresenceValidator.is_attached?(User, :username, { :if => :is_admin? })
|
59
59
|
end
|
60
60
|
|
61
|
-
In the file {validator_attachment_test.rb}[https://github.com/pmatsinopoulos/validator_attachment/blob/master/validator_attachment_test.rb]
|
61
|
+
In the file {validator_attachment_test.rb}[https://github.com/pmatsinopoulos/validator_attachment/blob/master/test/validator_attachment_test.rb]
|
62
62
|
you will see a lot of tests that I run to test the +gem+ and you can get ideas on you should use your assertions. You will see
|
63
63
|
there an example with a custom validator too.
|
64
64
|
|
@@ -67,15 +67,15 @@ there an example with a custom validator too.
|
|
67
67
|
It is easy to derive the class of the validator. The rule of thumb is that all Validators are +ActiveModel+ validators with
|
68
68
|
one exception that of +:uniqueness+, which is an +ActiveRecord+ Validator. However, here is a list that can help you:
|
69
69
|
|
70
|
-
:acceptance:: ActiveModel::AcceptanceValidator
|
71
|
-
:confirmation:: ActiveModel::ConfirmationValidator
|
72
|
-
:exclusion:: ActiveModel::ExclusionValidator
|
73
|
-
:format:: ActiveModel::FormatValidator
|
74
|
-
:inclusion:: ActiveModel::InclusionValidator
|
75
|
-
:length:: ActiveModel::LengthValidator
|
76
|
-
:numericality:: ActiveModel::NumericalityValidator
|
77
|
-
:uniqueness:: ActiveRecord::UniquenessValidator
|
78
|
-
:presence:: ActiveModel::PresenceValidator
|
70
|
+
:acceptance:: ActiveModel::Validations::AcceptanceValidator
|
71
|
+
:confirmation:: ActiveModel::Validations::ConfirmationValidator
|
72
|
+
:exclusion:: ActiveModel::Validations::ExclusionValidator
|
73
|
+
:format:: ActiveModel::Validations::FormatValidator
|
74
|
+
:inclusion:: ActiveModel::Validations::InclusionValidator
|
75
|
+
:length:: ActiveModel::Validations::LengthValidator
|
76
|
+
:numericality:: ActiveModel::Validations::NumericalityValidator
|
77
|
+
:uniqueness:: ActiveRecord::Validations::UniquenessValidator
|
78
|
+
:presence:: ActiveModel::Validations::PresenceValidator
|
79
79
|
|
80
80
|
== Issues
|
81
81
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{validator_attachment}
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{Panayotis Matsinopoulos}]
|
9
|
-
s.date = %q{2011-
|
9
|
+
s.date = %q{2011-11-01}
|
10
10
|
s.description = %q{Checks whether an ActiveModel Validator is attached to an attribute of a Model and with which options}
|
11
11
|
s.email = %q{panayotis@matsinopoulos.gr}
|
12
12
|
s.extra_rdoc_files = [%q{CHANGELOG}, %q{README.rdoc}, %q{lib/validator_attachment.rb}]
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Validator_attachment}, %q{--main}, %q{README.rdoc}]
|
16
16
|
s.require_paths = [%q{lib}]
|
17
17
|
s.rubyforge_project = %q{validator_attachment}
|
18
|
-
s.rubygems_version = %q{1.8.
|
18
|
+
s.rubygems_version = %q{1.8.6}
|
19
19
|
s.summary = %q{Is this ActiveModel Validator Used?}
|
20
20
|
s.test_files = [%q{test/validator_attachment_test.rb}, %q{test/test_helper.rb}]
|
21
21
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validator_attachment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Panayotis Matsinopoulos
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements: []
|
146
146
|
|
147
147
|
rubyforge_project: validator_attachment
|
148
|
-
rubygems_version: 1.8.
|
148
|
+
rubygems_version: 1.8.6
|
149
149
|
signing_key:
|
150
150
|
specification_version: 3
|
151
151
|
summary: Is this ActiveModel Validator Used?
|