<?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 on: Don&#8217;t overwrite Rails&#8217; built-in instance variables</title>
	<atom:link href="http://blog.lrdesign.com/2009/02/dont-overwrite-rails-built-in-instance-variables/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lrdesign.com/2009/02/dont-overwrite-rails-built-in-instance-variables/</link>
	<description>Logical Reality Design: Web Design and Software Development</description>
	<lastBuildDate>Wed, 14 Jul 2010 20:46:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Judson</title>
		<link>http://blog.lrdesign.com/2009/02/dont-overwrite-rails-built-in-instance-variables/comment-page-1/#comment-2952</link>
		<dc:creator>Judson</dc:creator>
		<pubDate>Mon, 16 Feb 2009 21:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lrdesign.com/?p=46#comment-2952</guid>
		<description>Preventing an instance variable being changed isn&#039;t something that Ruby can do.  You can only access @variable within the context of an instance, but within the instance you can do anything you want with it.

Your options are:

Update the Rails RSpec contexts to check that the instance variables respond to the right methods so that no matter what ill-informed (for which I&#039;d blame Rails, not a spec writer) modifications are made, a spec fails with a clear indication of the problem (&quot;@request should reply to :env&quot;)

Remember to use setters for Rails variables: self.request= ... which I&#039;d hope would perform those tests, or construct a proper request for them.</description>
		<content:encoded><![CDATA[<p>Preventing an instance variable being changed isn&#8217;t something that Ruby can do.  You can only access @variable within the context of an instance, but within the instance you can do anything you want with it.</p>
<p>Your options are:</p>
<p>Update the Rails RSpec contexts to check that the instance variables respond to the right methods so that no matter what ill-informed (for which I&#8217;d blame Rails, not a spec writer) modifications are made, a spec fails with a clear indication of the problem (&#8220;@request should reply to :env&#8221;)</p>
<p>Remember to use setters for Rails variables: self.request= &#8230; which I&#8217;d hope would perform those tests, or construct a proper request for them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
