Machinist with Non-ActiveRecord Models

32 views
Skip to first unread message

joe

unread,
Aug 19, 2010, 4:23:24 PM8/19/10
to Machinist Users
Hi,

I'm wondering if there is a way to use Machinist for non-activerecord
models. I'm currently using OpenStruct to make some mock data
structures for testing an external API, but I really like the
Machinist syntax for doing things. However, as you can imagine, I'm
running into a lot of "undefined method save" type errors. Has anyone
used Machinist for this sort of purpose? I'm using Rails 2.3.5 at the
moment if it matters.

Thanks for any advice!

Pete Yandell

unread,
Aug 19, 2010, 6:42:51 PM8/19/10
to machini...@googlegroups.com
On Fri, Aug 20, 2010 at 6:23 AM, joe <jelli...@gmail.com> wrote:
I'm wondering if there is a way to use Machinist for non-activerecord
models.

See the section on "Blueprints on Plain Old Ruby Objects" in the README: http://github.com/notahat/machinist/tree/1.0-maintenance

(You should be using 1.0. Machinist 2 doesn't really have explicit support for anything other than ActiveRecord yet.)

- Pete
Reply all
Reply to author
Forward
0 new messages