In blueprints:
User.blueprint do
attributes...
end
Point.blueprint do
user
value
end
Now I want to create named bluprint:
User.blueprint(:with_points) do
points { create points for that user}
end
How to pass user object to points?
Something like:
points { [Point.make(:user => self)] }
def make_user_with_points
user = User.make
3.times { user.points.make }
user
end
If you try to do it in the blueprint, ActiveRecord will try to save
the user so it can construct the points, but of course you haven't
finished constructing the user yet...
Machinist is good at attribute values, but it's not good at object
graphs.
- Pete