whyvalidationssuckin96 1.2.0 → 1.2.1

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.
Files changed (44) hide show
  1. data/README.md +6 -2
  2. data/VERSION +1 -1
  3. data/doc/ActiveRecord/RecordInvalid.html +12 -12
  4. data/doc/ActiveRecord.html +3 -3
  5. data/doc/FalseClass.html +2 -2
  6. data/doc/NilClass.html +2 -2
  7. data/doc/Numeric.html +2 -2
  8. data/doc/Object.html +2 -2
  9. data/doc/String.html +2 -2
  10. data/doc/TrueClass.html +2 -2
  11. data/doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation/ClassMethods.html +221 -0
  12. data/doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation.html +166 -0
  13. data/doc/WhyValidationsSuckIn96/ActiveRecord/ClassMethods.html +166 -0
  14. data/doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html +9 -9
  15. data/doc/WhyValidationsSuckIn96/ActiveRecord.html +90 -7
  16. data/doc/WhyValidationsSuckIn96/AttributeBasedValidation.html +2 -2
  17. data/doc/WhyValidationsSuckIn96/SkippableValidation.html +2 -2
  18. data/doc/WhyValidationsSuckIn96/ValidatesAcceptance.html +4 -4
  19. data/doc/WhyValidationsSuckIn96/ValidatesAssociated.html +2 -2
  20. data/doc/WhyValidationsSuckIn96/ValidatesConfirmation.html +2 -2
  21. data/doc/WhyValidationsSuckIn96/ValidatesExclusion.html +2 -2
  22. data/doc/WhyValidationsSuckIn96/ValidatesFormat.html +2 -2
  23. data/doc/WhyValidationsSuckIn96/ValidatesInclusion.html +2 -2
  24. data/doc/WhyValidationsSuckIn96/ValidatesLength.html +2 -2
  25. data/doc/WhyValidationsSuckIn96/ValidatesNumericality.html +2 -2
  26. data/doc/WhyValidationsSuckIn96/ValidatesPresence.html +2 -2
  27. data/doc/WhyValidationsSuckIn96/ValidatesUniqueness.html +2 -2
  28. data/doc/WhyValidationsSuckIn96/ValidatesUrl.html +2 -2
  29. data/doc/WhyValidationsSuckIn96/Validation.html +2 -2
  30. data/doc/WhyValidationsSuckIn96/ValidationBuilder.html +2 -2
  31. data/doc/WhyValidationsSuckIn96/ValidationSupport/ClassMethods.html +2 -2
  32. data/doc/WhyValidationsSuckIn96/ValidationSupport/InstanceMethods.html +2 -2
  33. data/doc/WhyValidationsSuckIn96/ValidationSupport.html +2 -2
  34. data/doc/WhyValidationsSuckIn96.html +3 -3
  35. data/doc/_index.html +30 -9
  36. data/doc/class_list.html +59 -29
  37. data/doc/file.README.html +9 -5
  38. data/doc/index.html +9 -5
  39. data/doc/method_list.html +104 -54
  40. data/doc/top-level-namespace.html +2 -2
  41. data/lib/whyvalidationssuckin96/macros/validates_length.rb +1 -0
  42. data/test/macros/validates_length_test.rb +5 -0
  43. data/whyvalidationssuckin96.gemspec +5 -2
  44. metadata +5 -2
@@ -72,9 +72,9 @@
72
72
  </div>
73
73
 
74
74
  <div id="footer">
75
- Generated on Mon Dec 21 16:56:22 2009 by
75
+ Generated on Mon Dec 21 23:30:38 2009 by
76
76
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
77
- 0.5.0 (ruby-1.8.7).
77
+ 0.5.2 (ruby-1.8.7).
78
78
  </div>
79
79
 
80
80
  </body>
@@ -53,6 +53,7 @@ module WhyValidationsSuckIn96
53
53
 
54
54
  def validate
55
55
  super
56
+ fail unless attribute_value.respond_to?(:size)
56
57
  all_valid = ValidOptions.collect do |opt_name|
57
58
  next(true) if options[opt_name].nil?
58
59
  send(:"validate_#{opt_name}")
@@ -14,6 +14,11 @@ context "validates length" do
14
14
  WhyValidationsSuckIn96::ValidatesLength.new(Object.new, :attribute => :text, :is => 3).message
15
15
  end.equals("does not meet the given length restrictions")
16
16
 
17
+ should "not blow up with a nil attribute" do
18
+ validation = WhyValidationsSuckIn96::ValidatesLength.new(OpenStruct.new(:text => nil), :attribute => :text, :is => 3)
19
+ validation.validates?
20
+ end.equals(false)
21
+
17
22
  context "when specifying the :is option" do
18
23
  should "not raise if solely :is is given" do
19
24
  WhyValidationsSuckIn96::ValidatesLength.new(Object.new, :attribute => :text, :is => 3)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whyvalidationssuckin96}
8
- s.version = "1.2.0"
8
+ s.version = "1.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["gabrielg", "douglasmeyer"]
12
- s.date = %q{2009-12-21}
12
+ s.date = %q{2009-12-22}
13
13
  s.description = %q{A library for setting up model validations, such as in ActiveRecord.}
14
14
  s.email = %q{gabriel.gironda@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -33,6 +33,9 @@ Gem::Specification.new do |s|
33
33
  "doc/TrueClass.html",
34
34
  "doc/WhyValidationsSuckIn96.html",
35
35
  "doc/WhyValidationsSuckIn96/ActiveRecord.html",
36
+ "doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation.html",
37
+ "doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation/ClassMethods.html",
38
+ "doc/WhyValidationsSuckIn96/ActiveRecord/ClassMethods.html",
36
39
  "doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html",
37
40
  "doc/WhyValidationsSuckIn96/AttributeBasedValidation.html",
38
41
  "doc/WhyValidationsSuckIn96/SkippableValidation.html",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whyvalidationssuckin96
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabrielg
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-12-21 00:00:00 -06:00
13
+ date: 2009-12-22 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -69,6 +69,9 @@ files:
69
69
  - doc/TrueClass.html
70
70
  - doc/WhyValidationsSuckIn96.html
71
71
  - doc/WhyValidationsSuckIn96/ActiveRecord.html
72
+ - doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation.html
73
+ - doc/WhyValidationsSuckIn96/ActiveRecord/AssociationValidation/ClassMethods.html
74
+ - doc/WhyValidationsSuckIn96/ActiveRecord/ClassMethods.html
72
75
  - doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html
73
76
  - doc/WhyValidationsSuckIn96/AttributeBasedValidation.html
74
77
  - doc/WhyValidationsSuckIn96/SkippableValidation.html