redtape 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Redtape
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/redtape.rb CHANGED
@@ -22,10 +22,9 @@ module Redtape
22
22
  begin
23
23
  model = send(accessor)
24
24
  unless model.valid?
25
- errors.add(
26
- model.class.to_s.underscore,
27
- model.errors.full_messages
28
- )
25
+ model.errors.each do |k, v|
26
+ errors.add(k, v)
27
+ end
29
28
  end
30
29
  rescue
31
30
  end
data/spec/form_spec.rb CHANGED
@@ -37,8 +37,6 @@ class TestRegistrationForm < Redtape::Form
37
37
 
38
38
  attr_accessor :first_name, :last_name
39
39
 
40
- validates_presence_of :first_name, :last_name
41
-
42
40
  def populate
43
41
  self.test_user = TestUser.new(:name => "#{first_name} #{last_name}")
44
42
  end
@@ -79,7 +77,7 @@ describe Redtape::Form do
79
77
 
80
78
  specify { subject.should_not be_valid }
81
79
  specify { subject.should_not be_persisted }
82
- specify { subject.errors.should have_key(:last_name) }
80
+ specify { subject.errors.should have_key(:name) }
83
81
  specify { subject.test_user.should_not be_valid }
84
82
  end
85
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redtape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: debugger
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
62
78
  - !ruby/object:Gem::Dependency
63
79
  name: activemodel
64
80
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
115
  version: '0'
100
116
  segments:
101
117
  - 0
102
- hash: -4120175038735653000
118
+ hash: -1141785784742973745
103
119
  required_rubygems_version: !ruby/object:Gem::Requirement
104
120
  none: false
105
121
  requirements:
@@ -108,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
124
  version: '0'
109
125
  segments:
110
126
  - 0
111
- hash: -4120175038735653000
127
+ hash: -1141785784742973745
112
128
  requirements: []
113
129
  rubyforge_project:
114
130
  rubygems_version: 1.8.24