Breaking up Blueprints.rb

26 views
Skip to first unread message

st23am

unread,
Aug 20, 2009, 4:18:16 PM8/20/09
to Machinist Users
Has anyone had success with breaking up your blueprint file into
multiple files for better organization. I am working on a project that
has a lot of models and a lot of custom fixtures that I am converting
into blueprints. So I would like to breakup the blueprint file into
smaller chunks.

Pete Yandell

unread,
Aug 23, 2009, 9:29:11 PM8/23/09
to Machinist Users


On Aug 21, 6:18 am, st23am <st2...@gmail.com> wrote:
> Has anyone had success with breaking up your blueprint file into
> multiple files for better organization?

I've never tried it, but it should work just fine. Just make multiple
files, and require them as needed.

Let me know how you go with it...I'm quite interested. Also interested
in what sort of project has that many models that you need to break up
the blueprints file! :)

- Pete

Martin Streicher

unread,
Aug 24, 2009, 11:01:41 AM8/24/09
to machini...@googlegroups.com

I have. It works fine and I like the granularity.

The top of my blueprints.rb looks like this...

require 'machinist/active_record'
require 'sham'
require 'faker'

Dir.require_all File.expand_path(File.dirname(__FILE__) + '/
blueprints' )

Sham.define do
Sham.address { Faker::Address.street_address }
Sham.city { Faker::Address.city }
...
end

st23am

unread,
Aug 24, 2009, 11:29:14 AM8/24/09
to Machinist Users
That looks like exactly what I was wanting to do. Thank you.

On Aug 24, 11:01 am, Martin Streicher <martin.streic...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages