Skip to content

Commit b02ecd4

Browse files
committed
use create! in simple model factory
1 parent b0b4bce commit b02ecd4

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### Fixed
2+
* simple factory fails silently, changed to use create!
3+
14
## 1.2.0
25
### Tasks
36
* adding additional log failure logging

spec/integrations/rails_3_2/app/models/post.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
class Post < OpenStruct
2+
def self.create!(attributes)
3+
create(attributes)
4+
end
5+
26
def self.create(attributes)
37
@all ||= []
48
post = new(attributes)

spec/integrations/rails_4_2/app/models/post.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
class Post < OpenStruct
2+
def self.create!(attributes)
3+
create(attributes)
4+
end
5+
26
def self.create(attributes)
37
@all ||= []
48
post = new(attributes)

0 commit comments

Comments
 (0)