<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Using Constants in Rails Models</title>
	<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 24 Jul 2008 00:30:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: Bill Eisenhauer</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-8221</link>
		<pubDate>Tue, 16 Oct 2007 12:19:59 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-8221</guid>
					<description>Yeah, I've had situations where I've added a model, then later deleted it, and thus broken the migration when it runs from an early version.  However, you can easily add the model into your migration to fix the migration.

I think this is a matter of style and my preference is still to use model constants in the migration.  It just seems more DRY and adds accuracy to your migration.

Thanks for your feedback!</description>
		<content:encoded><![CDATA[<p>Yeah, I&#8217;ve had situations where I&#8217;ve added a model, then later deleted it, and thus broken the migration when it runs from an early version.  However, you can easily add the model into your migration to fix the migration.</p>
<p>I think this is a matter of style and my preference is still to use model constants in the migration.  It just seems more DRY and adds accuracy to your migration.</p>
<p>Thanks for your feedback!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tom-Eric</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-8220</link>
		<pubDate>Tue, 16 Oct 2007 08:41:04 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-8220</guid>
					<description>You really shouldn't use your models in your migrations. It's now possible to break the migration file by modifying the model. You could solve this by placing the model in your migration file, but I'm not sure if that's the best solution.</description>
		<content:encoded><![CDATA[<p>You really shouldn&#8217;t use your models in your migrations. It&#8217;s now possible to break the migration file by modifying the model. You could solve this by placing the model in your migration file, but I&#8217;m not sure if that&#8217;s the best solution.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Bill Eisenhauer</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6938</link>
		<pubDate>Thu, 09 Aug 2007 01:13:09 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6938</guid>
					<description>Marcin,

I actually went back to my original code and it was correct there.  This means that it is either being stripped out by CodeRay or that there's a combination of characters that make the slash not render.

Sorta makes you want to be cautious about the code you lift from a blog, eh?  As always, one should know all of the code they deploy.

Thanks for the tip.

Bill</description>
		<content:encoded><![CDATA[<p>Marcin,</p>
<p>I actually went back to my original code and it was correct there.  This means that it is either being stripped out by CodeRay or that there&#8217;s a combination of characters that make the slash not render.</p>
<p>Sorta makes you want to be cautious about the code you lift from a blog, eh?  As always, one should know all of the code they deploy.</p>
<p>Thanks for the tip.</p>
<p>Bill
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Julian Schrader</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6936</link>
		<pubDate>Wed, 08 Aug 2007 21:33:08 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6936</guid>
					<description>Thanks for your great tips!

By the way: GeoKit has helped me a lot building &lt;a href="http://waschstrasse.info" rel="nofollow"&gt;Waschstrasse.info&lt;/a&gt;—thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for your great tips!</p>
<p>By the way: GeoKit has helped me a lot building <a href="http://waschstrasse.info" rel="nofollow">Waschstrasse.info</a>—thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Marcin Olak</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6931</link>
		<pubDate>Wed, 08 Aug 2007 14:28:03 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6931</guid>
					<description>From &lt;strong&gt;Programming Ruby&lt;/strong&gt;:

&lt;blockquote cite="Programming Ruby"&gt;[...] a period (.0) appearing outside brackets represents any character except a newline [...]&lt;/blockquote&gt;

Thus we need a backslash:
&lt;code&gt;
TO_FORMAT = /^[_a-z0-9+.-]+@[_a-z0-9-]+\.[_a-z0-9.-]+$/i
&lt;/code&gt;

I know the code is for demonstration purposes only but still, we don't want bugs to propagate throughtout the Internet from this magnificent blog :)</description>
		<content:encoded><![CDATA[<p>From <strong>Programming Ruby</strong>:</p>
<blockquote cite="Programming Ruby"><p>[&#8230;] a period (.0) appearing outside brackets represents any character except a newline [&#8230;]</p></blockquote>
<p>Thus we need a backslash:<br />
<code><br />
TO_FORMAT = /^[_a-z0-9+.-]+@[_a-z0-9-]+\.[_a-z0-9.-]+$/i<br />
</code></p>
<p>I know the code is for demonstration purposes only but still, we don&#8217;t want bugs to propagate throughtout the Internet from this magnificent blog :)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Marcin Olak</title>
		<link>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6916</link>
		<pubDate>Tue, 07 Aug 2007 09:22:51 +0000</pubDate>
		<guid>http://blog.billeisenhauer.com/2007/08/06/using-constants-in-rails-models/#comment-6916</guid>
					<description>I like this technique. BTW. GeoKit rocks! :)</description>
		<content:encoded><![CDATA[<p>I like this technique. BTW. GeoKit rocks! :)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
