modelizer 5.0.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/lib/modelizer.rb +6 -2
  3. metadata +4 -4
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ === 5.0.1 // 2011-09-14
2
+
3
+ * Include fixture name and errors when fixtures can't be saved.
4
+
1
5
  === 5.0.0 / 2011-09-11
2
6
 
3
7
  * Complete breaking change, now provides unified fixtures/factories.
data/lib/modelizer.rb CHANGED
@@ -2,7 +2,7 @@ require "zlib"
2
2
 
3
3
  module Modelizer
4
4
 
5
- VERSION = "5.0.0"
5
+ VERSION = "5.0.1"
6
6
 
7
7
  def build name, overrides = nil, &block
8
8
  model, *initializers = Modelizer.factories[name]
@@ -62,7 +62,11 @@ module Modelizer
62
62
  end
63
63
 
64
64
  ActiveRecord::Base.transaction do
65
- instances.each { |_, obj| obj.save! }
65
+ instances.each do |name, obj|
66
+ unless obj.save
67
+ raise "'#{name}' fixture can't be saved: #{obj.errors.full_messages}"
68
+ end
69
+ end
66
70
  end
67
71
  end
68
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modelizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-11 00:00:00.000000000Z
12
+ date: 2011-09-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hoe
16
- requirement: &70235549949760 !ruby/object:Gem::Requirement
16
+ requirement: &70313184032840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.12'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70235549949760
24
+ version_requirements: *70313184032840
25
25
  description: ! 'Need a simple, consistent way to create model instances and check
26
26
 
27
27
  validations in your ActiveRecord 3.1+ tests? Use the Modelizer. Just