Juan Kinunt wrote:
> Hi,
> 
> How can I populate a table (create several default objects) after a
> company (an object) is created. I would use after_create inside the
> Company model but I need to populate a lot of data and I think the model
> is not a good place. 

And I think you're wrong. :)  The model is the right place for logic 
that has to do with model objects!

> I'm thinking about having the data I want to
> populate in a yml file and insert it in a table when a company is
> created using after_create, but I don't know how to do that. 

You'd do it the same way as the first method; just read the YAML file 
instead of putting the data in the code.

> Any hint?
> Thanks!

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to