<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Code Colossus</title>
	<atom:link href="http://codecolossus.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://codecolossus.com</link>
	<description>Software Craftsmanship with Ruby</description>
	<lastBuildDate>Wed, 28 Dec 2011 17:54:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Using ActiveModel::Name to simplify URL generation by benhughes</title>
		<link>http://codecolossus.com/2011/05/01/using-activemodelname-to-simplify-url-generation/comment-page-1/#comment-6949</link>
		<dc:creator>benhughes</dc:creator>
		<pubDate>Wed, 28 Dec 2011 17:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=78#comment-6949</guid>
		<description>I dug into the Rails source to find out what exactly was generating those polymorphic_path URLs based on AR models, and saw it was ActiveModel::Naming&#039;s model_name, not class.name.</description>
		<content:encoded><![CDATA[<p>I dug into the Rails source to find out what exactly was generating those polymorphic_path URLs based on AR models, and saw it was ActiveModel::Naming&#8217;s model_name, not class.name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using ActiveModel::Name to simplify URL generation by andy</title>
		<link>http://codecolossus.com/2011/05/01/using-activemodelname-to-simplify-url-generation/comment-page-1/#comment-6948</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Wed, 28 Dec 2011 16:35:10 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=78#comment-6948</guid>
		<description>thanks so much. been finding this solution for 2 days. btw how do you find out &quot;self.model_name&quot;?</description>
		<content:encoded><![CDATA[<p>thanks so much. been finding this solution for 2 days. btw how do you find out &#8220;self.model_name&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord Drafts with has_draft by benhughes</title>
		<link>http://codecolossus.com/2008/12/30/activerecord-drafts-with-has_draft/comment-page-1/#comment-6799</link>
		<dc:creator>benhughes</dc:creator>
		<pubDate>Sun, 15 May 2011 17:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsgarden.com/2008/12/30/activerecord-drafts-with-has_draft/#comment-6799</guid>
		<description>Thanks, fixed!</description>
		<content:encoded><![CDATA[<p>Thanks, fixed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord Drafts with has_draft by Ramon</title>
		<link>http://codecolossus.com/2008/12/30/activerecord-drafts-with-has_draft/comment-page-1/#comment-6797</link>
		<dc:creator>Ramon</dc:creator>
		<pubDate>Sun, 15 May 2011 13:04:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsgarden.com/2008/12/30/activerecord-drafts-with-has_draft/#comment-6797</guid>
		<description>Looks like your link has moved to https://github.com/rubiety/has_draft</description>
		<content:encoded><![CDATA[<p>Looks like your link has moved to <a href="https://github.com/rubiety/has_draft" rel="nofollow">https://github.com/rubiety/has_draft</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using ActiveModel::Name to simplify URL generation by jaye</title>
		<link>http://codecolossus.com/2011/05/01/using-activemodelname-to-simplify-url-generation/comment-page-1/#comment-6725</link>
		<dc:creator>jaye</dc:creator>
		<pubDate>Mon, 02 May 2011 09:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=78#comment-6725</guid>
		<description>beautiful. Thanks</description>
		<content:encoded><![CDATA[<p>beautiful. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on message_block: a error_messages_for replacement for flash message and model error handling by Bill</title>
		<link>http://codecolossus.com/2008/11/26/message_block-a-error_messages_for-replacement-for-flash-message-and-model-error-handling/comment-page-1/#comment-6718</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 10 Feb 2011 04:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsgarden.com/2008/11/26/message_block-a-error_messages_for-replacement-for-flash-message-and-model-error-handling/#comment-6718</guid>
		<description>It&#039;s here:

https://github.com/rubiety/message_block</description>
		<content:encoded><![CDATA[<p>It&#8217;s here:</p>
<p><a href="https://github.com/rubiety/message_block" rel="nofollow">https://github.com/rubiety/message_block</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why you should always validate maximum lengths in models, and how to do so easily by Eric Anderson</title>
		<link>http://codecolossus.com/2011/01/01/why-you-should-always-validate-db-maximum-lengths-and-how-to-do-so-easily/comment-page-1/#comment-6665</link>
		<dc:creator>Eric Anderson</dc:creator>
		<pubDate>Sun, 02 Jan 2011 20:55:21 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=69#comment-6665</guid>
		<description>Doing validations based on the database schema is something I have been doing for a long time in Rails and can&#039;t imagine doing it differently. Just way to many validation statements to write otherwise.

I used to use schema_validations plugin[1] but the developers stopped supporting it a while back. Plus it was very heavy-weight. Recently I have been using enforce_schmea_rules[2] which I even contributed patches too (to make it Rails 3 compat). I think it needs better testing still and the code is a bit old but it works well and might be something to look into to get ideas.


1. https://github.com/harukizaemon/redhillonrails/tree/master/schema_validations
2. https://github.com/twinge/enforce_schema_rules</description>
		<content:encoded><![CDATA[<p>Doing validations based on the database schema is something I have been doing for a long time in Rails and can&#8217;t imagine doing it differently. Just way to many validation statements to write otherwise.</p>
<p>I used to use schema_validations plugin[1] but the developers stopped supporting it a while back. Plus it was very heavy-weight. Recently I have been using enforce_schmea_rules[2] which I even contributed patches too (to make it Rails 3 compat). I think it needs better testing still and the code is a bit old but it works well and might be something to look into to get ideas.</p>
<p>1. <a href="https://github.com/harukizaemon/redhillonrails/tree/master/schema_validations" rel="nofollow">https://github.com/harukizaemon/redhillonrails/tree/master/schema_validations</a><br />
2. <a href="https://github.com/twinge/enforce_schema_rules" rel="nofollow">https://github.com/twinge/enforce_schema_rules</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why you should always validate maximum lengths in models, and how to do so easily by benhughes</title>
		<link>http://codecolossus.com/2011/01/01/why-you-should-always-validate-db-maximum-lengths-and-how-to-do-so-easily/comment-page-1/#comment-6663</link>
		<dc:creator>benhughes</dc:creator>
		<pubDate>Sun, 02 Jan 2011 19:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=69#comment-6663</guid>
		<description>Ben - Great points about the numeric columns.  I haven&#039;t even considered them being a problem as well, but indeed they are.  Thanks for your commit adding this to the project; I&#039;ll have to add supporting tests and modify the README to reflect the changes, then I&#039;ll push them up and release in a few days.</description>
		<content:encoded><![CDATA[<p>Ben &#8211; Great points about the numeric columns.  I haven&#8217;t even considered them being a problem as well, but indeed they are.  Thanks for your commit adding this to the project; I&#8217;ll have to add supporting tests and modify the README to reflect the changes, then I&#8217;ll push them up and release in a few days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why you should always validate maximum lengths in models, and how to do so easily by Ben Simpson</title>
		<link>http://codecolossus.com/2011/01/01/why-you-should-always-validate-db-maximum-lengths-and-how-to-do-so-easily/comment-page-1/#comment-6662</link>
		<dc:creator>Ben Simpson</dc:creator>
		<pubDate>Sun, 02 Jan 2011 18:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=69#comment-6662</guid>
		<description>I agree that point #2 is a big issue (especially with MySQL). Since the truncation is silent, you wouldn&#039;t know its gone until you query again. No exceptions are thrown, and ActiveRecord happily goes on about its day.

As an interesting note, Sqlite supports dynamic typing, which I discovered makes it very hard to get it to truncate a value since it does its best to accommodate (From their website: &quot;You can put arbitrary length strings into integer columns, floating point numbers in boolean columns, or dates in character columns&quot;.) While that takes care of point #2, it compounds the Denial Of Service and data integrity issues.

Your plugin is a great way to ensure that text and string datatypes are not truncated, you are helping prevent a DOS attack, however the mentioned issues seems to occur with numerical datatypes on MySQL as well.

I forked your project on Github to play around with, and pulling back the curtains on the migration transitions to database column types is horrifying. If precision and scale aren&#039;t specified in a decimal column definition for a migration, Rails treats it as a type integer. Floats, decimals, and integers all silently truncate. Floats truncating are probably fine, since this is the design idea behind a float rounding.

Decimals should have precision and scale enforced before save. Integers should also report if there is possible truncation. Hopefully the code I pushed is helpful in some way.

Great work!</description>
		<content:encoded><![CDATA[<p>I agree that point #2 is a big issue (especially with MySQL). Since the truncation is silent, you wouldn&#8217;t know its gone until you query again. No exceptions are thrown, and ActiveRecord happily goes on about its day.</p>
<p>As an interesting note, Sqlite supports dynamic typing, which I discovered makes it very hard to get it to truncate a value since it does its best to accommodate (From their website: &#8220;You can put arbitrary length strings into integer columns, floating point numbers in boolean columns, or dates in character columns&#8221;.) While that takes care of point #2, it compounds the Denial Of Service and data integrity issues.</p>
<p>Your plugin is a great way to ensure that text and string datatypes are not truncated, you are helping prevent a DOS attack, however the mentioned issues seems to occur with numerical datatypes on MySQL as well.</p>
<p>I forked your project on Github to play around with, and pulling back the curtains on the migration transitions to database column types is horrifying. If precision and scale aren&#8217;t specified in a decimal column definition for a migration, Rails treats it as a type integer. Floats, decimals, and integers all silently truncate. Floats truncating are probably fine, since this is the design idea behind a float rounding.</p>
<p>Decimals should have precision and scale enforced before save. Integers should also report if there is possible truncation. Hopefully the code I pushed is helpful in some way.</p>
<p>Great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why you should always validate maximum lengths in models, and how to do so easily by Michael Raidel</title>
		<link>http://codecolossus.com/2011/01/01/why-you-should-always-validate-db-maximum-lengths-and-how-to-do-so-easily/comment-page-1/#comment-6661</link>
		<dc:creator>Michael Raidel</dc:creator>
		<pubDate>Sun, 02 Jan 2011 14:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://codecolossus.com/?p=69#comment-6661</guid>
		<description>Very good idea Ben!</description>
		<content:encoded><![CDATA[<p>Very good idea Ben!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

