<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Assigning Non-Sequential IDs in Rails</title>
	<atom:link href="http://blog.thescoop.org/archives/2008/05/08/assigning-non-sequential-ids-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thescoop.org/archives/2008/05/08/assigning-non-sequential-ids-in-rails/</link>
	<description>Derek Willis' weblog on investigative and computer-assisted reporting.</description>
	<pubDate>Sun, 07 Sep 2008 01:07:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-bleeding</generator>
		<item>
		<title>By: Mason</title>
		<link>http://blog.thescoop.org/archives/2008/05/08/assigning-non-sequential-ids-in-rails/#comment-128274</link>
		<dc:creator>Mason</dc:creator>
		<pubDate>Sat, 17 May 2008 08:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.thescoop.org/?p=5112#comment-128274</guid>
		<description>No reason you couldn't drop the params hash in there and then do the manual assign:

@person = Person.new(params["person"])
@person.id = params["person"]["id"]
@person.save

OR... you can have the form call your ID param something else, like params["person"]["legacy_id"]  and then define :legacy_id= for person:

class Person &#60; ActiveRecord::Base
def legacy_id=(v)
  self.id = v
end
# for consistency
def legacy_id
  self.id
end
end

@person = Person.new(params["person"])
@person.save

Plenty of ways to hit the same solution.</description>
		<content:encoded><![CDATA[<p>No reason you couldn&#8217;t drop the params hash in there and then do the manual assign:</p>
<p>@person = Person.new(params["person"])<br />
@person.id = params["person"]["id"]<br />
@person.save</p>
<p>OR&#8230; you can have the form call your ID param something else, like params["person"]["legacy_id"]  and then define :legacy_id= for person:</p>
<p>class Person &lt; ActiveRecord::Base<br />
def legacy_id=(v)<br />
  self.id = v<br />
end<br />
# for consistency<br />
def legacy_id<br />
  self.id<br />
end<br />
end</p>
<p>@person = Person.new(params["person"])<br />
@person.save</p>
<p>Plenty of ways to hit the same solution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
