Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Fail to import record with explicit record ID

#27

Example:

attributes = [:id, :name, :classification, :parent_id]
values = [[1,"guppy", "fish", 1], [2, "goldfish", "fish", 1], [3, "parrot fish", "fish", 1]]
Animals.import attributes, values

Problems/Oddities:

  • For one value the record gets inserted with a random ID (generated where?)
  • For multiple values only the first one gets inserted - with incorrect ID

Note: Tested both Sqlite and Postgres

Reported by Jonas Grimfelt · July 6th, 2009 @ 10:38 AM

State: new
Milestone: none
Assigned to: Zach Dennis Zach Dennis

Activity

  1. Jonas Grimfelt
    Jonas Grimfelt

    Ignore this, it's an Rails ActiveRecord issue...a bit stupid convention not being able to save ID without before_filters. =/

    July 6th, 2009 @ 01:03 PM

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.