factory_girl is not compatible with Sequel?

1,162 views
Skip to first unread message

陈若涵

unread,
Aug 6, 2012, 4:01:51 AM8/6/12
to factor...@googlegroups.com
> pry(main)> create(:user)
> NoMethodError: undefined method `save!' for #<TiebaXiaoshuoBot::User:0x007ff3d1cb2330>
> from /Users/crhan/.rvm/gems/ruby-1.9.3-p125/gems/factory_girl-4.0.0/lib/factory_girl/configuration.rb:14:in `block in initialize'

Sequel's model only have `save` method, but no `save!` method, so that is the problem.

So will Sequel be supported in the future version?

Joe Ferris

unread,
Aug 6, 2012, 9:53:29 AM8/6/12
to factor...@googlegroups.com
If sequel doesn't support #save!, you can override the persistence strategy for those factories (or for all factories): https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#custom-methods-to-persist-objects

-Joe
--
Individuals over processes. Interactions over tools. Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training
 
You received this message because you are subscribed to the "factory_girl" mailing list.
To post to this group, send email to factor...@googlegroups.com
To unsubscribe from this group, send email to
factory_girl...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/factory_girl?hl=en

Reply all
Reply to author
Forward
0 new messages