You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I have imported data using ar_extensions 0.9.3 into sqlite 1.3.2 with impressive results. Now I want to process that data updating some fields in same table. The table has :id as primary key
options = {:validate => false, :on_duplicate_key_update => [:x]}
columns = [ :id,:x]
igcfs = Igcfile.find(:all) # get files
igcfs.each do |igcf| # for each file
ps=[]
igcps = igcf.igcpoint(:all, :order => 'seq_secs') # get points
igcps.each do |igcp| # for each point
process data
ps<<[igcp.id,igcp.x] # push data to array
end
Igcpoint.import columns, ps, options # update DB
end
development.log sais - WARNING: Can't mass-assign these protected attributes: id
Hi
I have imported data using ar_extensions 0.9.3 into sqlite 1.3.2 with impressive results. Now I want to process that data updating some fields in same table. The table has :id as primary key
process data
development.log sais - WARNING: Can't mass-assign these protected attributes: id
I see that this issue turned up a year ago. Not fixed yet?
http://zdennis.lighthouseapp.com/projects/14379/tickets/26-cant-import-protected-attributes
If there is no fix then it looks like a workaroundmight be to create a 2nd unique key and use that instead of :id
Peter
The text was updated successfully, but these errors were encountered: