#8 new
jschank

Associations not used

Reported by jschank | August 23rd, 2008 @ 02:19 AM

Hello, If I have an association, such as belongs_to, and I attempt to do an import like so: @parent.things.import fields, data the imported objects do not have a parent_id in them. (to be fair, there was no such column in the input data) Also, my models validates_presence_of :parent_id did not get triggered on my import.

So, It would be nice if there was a way, perhaps an option, where I could pass in a hash, that can be added to each row before the insert happens. This would allow me to do something like :options => { :add_values => { :parent_id => 3} } Forgive me if the syntax is messed up, I'm pretty much a nuby on rails.

Thanks, John Schank

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

ActiveRecord::Extension (aka ar-extensions) is a plugin to extend and
enhance the functionality of ActiveRecord. It starts by adding better
find support for ActiveRecord. It then adds mass data import
capabilities which are highly efficient and lastly it supports to_csv
functionality.

It also introduces a cool concept of creating easily extendable pieces
of ActiveRecord functionality, so developers don't have to understand
ActiveRecord internals or have the fear of breaking ActiveRecord
itself.

People watching this ticket

Tags

Pages