<?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: [BTS] Magic Models &#8211; Class creation</title>
	<atom:link href="http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<lastBuildDate>Tue, 16 Mar 2010 14:19:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anil</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-56933</link>
		<dc:creator>Anil</dc:creator>
		<pubDate>Thu, 15 Nov 2007 22:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-56933</guid>
		<description>I want to create an internal admin view to display the output of &quot;show variables&quot; from mysql. What&#039;s the best approach do this?

For example, I&#039;m doing something like this:

@variables = ActiveRecord::Base.find_by_sql &quot;show variables;&quot; 

Then, I get stuff like this back (227 elements in @variables) in script/console:

&gt;&gt; @variables[0]
=&gt; #&quot;auto_increment_increment&quot;, &quot;Value&quot;=&gt;&quot;1&quot;}&gt;

However, I&#039;m not sure how to get Variable_name and Value; do I access this as a Hash element?  An attribute?

Should I create a custom Model class such as this?
 class MySql </description>
		<content:encoded><![CDATA[<p>I want to create an internal admin view to display the output of &#8220;show variables&#8221; from mysql. What&#8217;s the best approach do this?</p>
<p>For example, I&#8217;m doing something like this:</p>
<p>@variables = ActiveRecord::Base.find_by_sql &#8220;show variables;&#8221; </p>
<p>Then, I get stuff like this back (227 elements in @variables) in script/console:</p>
<p>&gt;&gt; @variables[0]<br />
=&gt; #&#8221;auto_increment_increment&#8221;, &#8220;Value&#8221;=&gt;&#8221;1&#8243;}&gt;</p>
<p>However, I&#8217;m not sure how to get Variable_name and Value; do I access this as a Hash element?  An attribute?</p>
<p>Should I create a custom Model class such as this?<br />
 class MySql</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby, a message to you &#187; GuessMethod 0.1.1 - Now works with Rails!</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-54860</link>
		<dc:creator>Ruby, a message to you &#187; GuessMethod 0.1.1 - Now works with Rails!</dc:creator>
		<pubDate>Fri, 09 Nov 2007 01:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-54860</guid>
		<description>[...] It was this old Dr. Nic post that got me over the hurdle solving this one. Thanks Dr. Nic. [...]</description>
		<content:encoded><![CDATA[<p>[...] It was this old Dr. Nic post that got me over the hurdle solving this one. Thanks Dr. Nic. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-22877</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 09 May 2007 13:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-22877</guid>
		<description>The memories indeed. I think I might still have my BTN report books. I never used so much coloured pen to make those reports look purdy.

Great post. Its emboldens me to see successful plugins demonstrate some deep class overiding. Something I might normally avoid thinking I should find another way.

Sorry for the late comment, but when I saw BTN i had to.</description>
		<content:encoded><![CDATA[<p>The memories indeed. I think I might still have my BTN report books. I never used so much coloured pen to make those reports look purdy.</p>
<p>Great post. Its emboldens me to see successful plugins demonstrate some deep class overiding. Something I might normally avoid thinking I should find another way.</p>
<p>Sorry for the late comment, but when I saw BTN i had to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-5550</link>
		<dc:creator>Dr Nic</dc:creator>
		<pubDate>Tue, 13 Feb 2007 10:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-5550</guid>
		<description>@sergio - thanks for that. Fixed to use lots of single quotes. Wordpress is converting all double quotes to fancy-pants curly quotes, and these don&#039;t copy+paste well!</description>
		<content:encoded><![CDATA[<p>@sergio &#8211; thanks for that. Fixed to use lots of single quotes. Wordpress is converting all double quotes to fancy-pants curly quotes, and these don&#8217;t copy+paste well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio Espeja</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-5549</link>
		<dc:creator>Sergio Espeja</dc:creator>
		<pubDate>Tue, 13 Feb 2007 10:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-5549</guid>
		<description>Very interesting Ruby meta-programming tips!

I think that there&#039;s an error in proposed code:
klass_code = %q{def to_s; &quot;I&#039;m magically generated&#039;; end }

The closing quotation mark need to be double instead of simple, like:
klass_code = %q{def to_s; &quot;I&#039;m magically generated&quot;; end }</description>
		<content:encoded><![CDATA[<p>Very interesting Ruby meta-programming tips!</p>
<p>I think that there&#8217;s an error in proposed code:<br />
klass_code = %q{def to_s; &#8220;I&#8217;m magically generated&#8217;; end }</p>
<p>The closing quotation mark need to be double instead of simple, like:<br />
klass_code = %q{def to_s; &#8220;I&#8217;m magically generated&#8221;; end }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: computers should be less friendly &#187; Blog Archive &#187; ABAP Magic Models</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-828</link>
		<dc:creator>computers should be less friendly &#187; Blog Archive &#187; ABAP Magic Models</dc:creator>
		<pubDate>Sun, 26 Nov 2006 22:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-828</guid>
		<description>[...] After reading a lot about Rails and it&#8217;s former inclusion (thanks to Tom and Ryan) of a bunch of REST functionality into the next release and a blog by Dr. Nic  about his Magic Models project I&#8217;ve decided to embark on a new project. [...]</description>
		<content:encoded><![CDATA[<p>[...] After reading a lot about Rails and it&#8217;s former inclusion (thanks to Tom and Ryan) of a bunch of REST functionality into the next release and a blog by Dr. Nic  about his Magic Models project I&#8217;ve decided to embark on a new project. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Martin</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-307</link>
		<dc:creator>Tony Martin</dc:creator>
		<pubDate>Wed, 04 Oct 2006 17:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-307</guid>
		<description>Being still a bit new to Ruby and Rails, I find the article useful but would have found a slightly more detailed explanation helpful.</description>
		<content:encoded><![CDATA[<p>Being still a bit new to Ruby and Rails, I find the article useful but would have found a slightly more detailed explanation helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-93</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Tue, 15 Aug 2006 19:20:21 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-93</guid>
		<description>Just beutiful. I had been creating &#039;Generic&#039; ActiveRecords like &lt;code&gt;ActiveRecord::Base.find_by_sql(&quot;SELECT * FROM #{table})&lt;/code&gt; in throwaway scripts. And then accessing the results with the &#039;_before_type_cast&#039; magic method. But this is so elegant.</description>
		<content:encoded><![CDATA[<p>Just beutiful. I had been creating &#8216;Generic&#8217; ActiveRecords like <code>ActiveRecord::Base.find_by_sql("SELECT * FROM #{table})</code> in throwaway scripts. And then accessing the results with the &#8216;_before_type_cast&#8217; magic method. But this is so elegant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hammed</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-66</link>
		<dc:creator>Hammed</dc:creator>
		<pubDate>Mon, 14 Aug 2006 10:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-66</guid>
		<description>Dr. Nic,

Nice writeup. Looking forward to more articles like this one. Thanks!</description>
		<content:encoded><![CDATA[<p>Dr. Nic,</p>
<p>Nice writeup. Looking forward to more articles like this one. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/comment-page-1/#comment-50</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Sun, 13 Aug 2006 11:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/10/bts-magic-models-class-creation/#comment-50</guid>
		<description>Great post, Not too long, but still just enough to make people want to look BTS.</description>
		<content:encoded><![CDATA[<p>Great post, Not too long, but still just enough to make people want to look BTS.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
