ActiveRecord::Fixtures don't use custom create methods of oracle-enhanced

11 views
Skip to first unread message

Pavel Shapoval

unread,
Jan 7, 2013, 1:50:08 PM1/7/13
to oracle-...@googlegroups.com
I'm trying to use ActiveRecord::Fixtures with custom create method and it's don't work (it's use regular model create method and ignore set_create_method) but it works perfectly if I try to use it elsewhere without fixtures. Do some one have any clue?

Raimonds Simanovskis

unread,
Jan 15, 2013, 6:35:15 AM1/15/13
to oracle-...@googlegroups.com
ActiveRecord fixtures are not using standard model create method but are using connection insert_fixture method to insert directly rows in corresponding table and skips all ActiveRecord creation logic.

Therefore instead of fixtures I recommend to use some test data factory approach (e.g. use factory_girl gem) or just create your own test helper methods which create data using model create method.

Kind regards,
Raimonds
Reply all
Reply to author
Forward
0 new messages