<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dr Nic &#187; Magic Model Generator</title>
	<atom:link href="http://drnicwilliams.com/category/ruby/ruby-on-rails/magic-models/magic-model-generator/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<lastBuildDate>Tue, 01 Jun 2010 12:54:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Smart people doing smart things in Netherlands &#8211; RubyEnRails 2007</title>
		<link>http://drnicwilliams.com/2007/06/09/smart-people-doing-smart-things-in-netherlands-rubyenrails-2007/</link>
		<comments>http://drnicwilliams.com/2007/06/09/smart-people-doing-smart-things-in-netherlands-rubyenrails-2007/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 07:35:45 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Magic Model Generator]]></category>
		<category><![CDATA[NewGem]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/06/09/smart-people-doing-smart-things-in-netherlands-rubyenrails-2007/</guid>
		<description><![CDATA[Summary: click to select Photo by Thijs van der Vossen,Fingertips For one million people in Amsterdam, time stood still as a parade of Rails gurus in Netherlands/ Belgium talked up a storm at RubyEnRails 2007. Only 240 were allow inside to the free, one day conference, so riots ensued at the doorsteps of the building. [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2009/04/06/easy-scheduling-by-location-tasks-and-people-a-case-study-of-a-client-application-from-mocra/' rel='bookmark' title='Permanent Link: Easy scheduling by location, tasks and people &#8211; a case study of a client application from Mocra'>Easy scheduling by location, tasks and people &#8211; a case study of a client application from Mocra</a> <small> UPDATE: Orchestrate was reported in TechCrunch Several years ago...</small></li><li><a href='http://drnicwilliams.com/2007/03/22/meta-magic-in-ruby-presentation/' rel='bookmark' title='Permanent Link: Meta-Magic in Ruby: Dr Nic Unplugged in Stockholm'>Meta-Magic in Ruby: Dr Nic Unplugged in Stockholm</a> <small>Last nights&#8217; Ruby meeting in Stockholm had a great turn...</small></li><li><a href='http://drnicwilliams.com/2006/10/06/amsterdam-rails-catchup-summary/' rel='bookmark' title='Permanent Link: Amsterdam Rails Catchup summary'>Amsterdam Rails Catchup summary</a> <small>It was brilliant to meet up with a dozen or...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p id="bk_summary_192" name="bk_summary_192" class="bk_summary"><strong>Summary: </strong> <span class="help">click to select</span></p>
<input id="bk_summary_input_192" value="Slides of Dr Nic's keynote and 'DIY Syntax' sessions at RubyEnRails 2007" style="width:100%"  onClick="javascript:var summary = document.getElementById('bk_summary_input_192'); summary.focus();summary.select();" readonly="true" /></span></p>
<div>
<div style="float: right">
<p><a class="imagelink" href="http://www.fngtps.com/2007/06/rubyenrails-2007" title="rubyenrails2007-me-presenting-by-fngtps.jpg"><img width="200" id="image191" src="http://drnicwilliams.com/wp-content/uploads/2007/06/rubyenrails2007-me-presenting-by-fngtps.jpg" alt="rubyenrails2007-me-presenting-by-fngtps.jpg" /></a></p>
<p>
<caption>Photo by Thijs van der Vossen,<br/><a href="http://www.fngtps.com">Fingertips</a></caption>
</p>
</div>
<p>For one million people in Amsterdam, time stood still as a parade of Rails gurus in Netherlands/ Belgium talked up a storm at <a href="http://2007.rubyenrails.nl">RubyEnRails 2007</a>. Only 240 were allow inside to the free, one day conference, so riots ensued at the doorsteps of the building. Police were called in. Helicopters. Tanks.</p>
<p>Or so I&#8217;m told. I was too busy inside meeting many very clever developers and sharp business people. The buzz of excitement for Rails in the foyer during the breaks was tremendous. The conference organisers recorded the audio of all presentations which will be great to listen to.
</p>
<p>I was flown in my private jet, helicoptered to the conference building and shepherded in by 24 Dutch Special Forces men, all of equal height and build, identical in every fashion. Before my keynote, I was interviewed by all the major TV networks. I have no idea what drives me to make this all up.</p>
<p>But I was given a free RubyEnRails conference t-shirt. I was also able to give a couple of presentations:</p>
</div>
<h3>Keynote</h3>
<div>
<object style="float:right" type="application/x-shockwave-flash" data="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=61632&#038;doc=rubyenrails2007-dr-nic-williams-keynote4975" width="312" height="220"><param name="movie" value="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=61632&#038;doc=rubyenrails2007-dr-nic-williams-keynote4975" /></object></p>
<p>It was a wonderful opportunity to start the day, and I shared &#8220;What&#8217;s cool with Rails?&#8221; focusing on some hot potatoes like scaling and deployment, as well as RESTfulness. <a href="http://www.slideshare.net/drnic/rubyenrails2007-dr-nic-williams-keynote/">Slides here</a>.</p>
<p>Ultimately the basic theme of the keynote was &#8220;Its all just text&#8221;, and choosing between Rails, Merb, Camping, Mongrel handlers, becomes a design/architectural decision to be made for each portion of each application you build.</p>
<p>I included a live demo of the Magic Model Generator, and encouraged people to write RubyGems instead of Rails plugins, as they provide better support for: dependencies, versioning, and reuse outside of Rails.</p>
</div>
<h3>DIY syntax</h3>
<div>
<object style="float: right" type="application/x-shockwave-flash" data="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=61633&#038;doc=rubyenrails2007-dr-nic-williams-diy-syntax820" width="312" height="220"><param name="movie" value="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=61633&#038;doc=rubyenrails2007-dr-nic-williams-diy-syntax820" /></object></p>
<p>The ability to extend my programming language tickles me pink. Often you write a block of code and you just think &#8220;That should be prettier and simpler&#8221;.</p>
<p>With Ruby meta-programming, blocks, method_missing, const_missing and optional parentheses you can craft nearly any syntactic sugar you like to replace lengthy, complicated code.</p>
<p><a href="http://www.slideshare.net/drnic/rubyenrails2007-dr-nic-williams-diy-syntax/">Slides here.</a></p>
</div>
<h3>Dr Nic Academy</h3>
<p>I also took the opportunity to introduce Dr Nic Academy &#8211; training courses in Ruby on Rails by me. The first course will be <a href="http://drnicacademy.eventwax.com/beginning-ruby-on-rails">7th and 8th of July in Amsterdam</a>. If you are thinking of attending, hold off buying tickets!! The new website and a special bonus discount price will be coming soon. I&#8217;d hate you to miss out.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2009/04/06/easy-scheduling-by-location-tasks-and-people-a-case-study-of-a-client-application-from-mocra/' rel='bookmark' title='Permanent Link: Easy scheduling by location, tasks and people &#8211; a case study of a client application from Mocra'>Easy scheduling by location, tasks and people &#8211; a case study of a client application from Mocra</a> <small> UPDATE: Orchestrate was reported in TechCrunch Several years ago...</small></li><li><a href='http://drnicwilliams.com/2007/03/22/meta-magic-in-ruby-presentation/' rel='bookmark' title='Permanent Link: Meta-Magic in Ruby: Dr Nic Unplugged in Stockholm'>Meta-Magic in Ruby: Dr Nic Unplugged in Stockholm</a> <small>Last nights&#8217; Ruby meeting in Stockholm had a great turn...</small></li><li><a href='http://drnicwilliams.com/2006/10/06/amsterdam-rails-catchup-summary/' rel='bookmark' title='Permanent Link: Amsterdam Rails Catchup summary'>Amsterdam Rails Catchup summary</a> <small>It was brilliant to meet up with a dozen or...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/06/09/smart-people-doing-smart-things-in-netherlands-rubyenrails-2007/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Dr Nic&#8217;s Magic Show at RejectConf2007</title>
		<link>http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/</link>
		<comments>http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/#comments</comments>
		<pubDate>Tue, 22 May 2007 23:34:50 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Magic Model Generator]]></category>
		<category><![CDATA[Magic Models]]></category>
		<category><![CDATA[RejectConf]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/</guid>
		<description><![CDATA[Update: there is a patch available for edge rails to support merging by generators; add comments to the ticket. The original Dr Nic&#8217;s Magic Models were named as such because I entertained the idea of showing them off as a live magic show. So, given 3 minutes in front of some of the Ruby community&#8217;s [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/20/newgem-using-rubigen-for-generator-support/' rel='bookmark' title='Permanent Link: NewGem Generator &#8211; now with script/generate'>NewGem Generator &#8211; now with script/generate</a> <small>The New Gem Generator (0.13.0)&#8217;s newgem command now behaves like...</small></li><li><a href='http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/' rel='bookmark' title='Permanent Link: Magic Wiggly Lines => GuessMethod, by Chris Shea'>Magic Wiggly Lines => GuessMethod, by Chris Shea</a> <small>If you ever make time to code just for pleasure,...</small></li><li><a href='http://drnicwilliams.com/2007/05/27/new-gem-generates-gets-rspec-video/' rel='bookmark' title='Permanent Link: New Gem Generator gets RSpec [video]'>New Gem Generator gets RSpec [video]</a> <small> One day you will be able to write a...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> there is a patch available for edge rails to support <a href="http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/#comment-26294">merging by generators</a>; add comments to the <a href="http://dev.rubyonrails.org/ticket/8439">ticket</a>.</p>
<hr/>
<p>The original Dr Nic&#8217;s Magic Models were named as such because I entertained the idea of showing them off as a live magic show. So, given 3 minutes in front of some of the Ruby community&#8217;s hottest hackers, I got my chance! Not the Original Magic Models, but the never-before-released <a href="http://magicmodels.rubyforge.org/magic_model_generator/">Magic Model Generator</a>.</p>
<p>How to install and use the <code>magic_model_generator</code> follows the video from RejectConf:</p>
<h3>The Magic Show</h3>
<p><embed style="width:500px; height:426px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-603944638448214790&#38;hl=en" flashvars=""> </embed></p>
<h3>How to use it</h3>
<p>Create a rails application, and point it to your database.</p>
<pre>$ rails magic_show -d [mysql|sqlite|postgresql|oracle|etc|etc]
$ cd magic_show
$ cp database.yml.sample database.yml
and point it to your database.yml to your legacy database
</pre>
<p>I use the database created for the ActiveRecord test cases &#8211; <code>activerecord_unittest</code>. If you&#8217;ve never downloaded the activerecord gem, run <code>rake build_[mysql|sqlite|postgresql|oracle|etc|etc]_databases</code>, and then <code>rake test_[mysql|sqlite|postgresql|oracle|etc|etc]</code>, then you&#8217;ve probably got more free time than I do as a result and I appreciate that. And so does my wife.</p>
<p>Now install the <code>magic_model_generator</code> gem:</p>
<pre>$ sudo gem install magic_model_generator</pre>
<p>Nonetheless, you&#8217;re done. That&#8217;s all the preparation I did for the video.</p>
<p>Next I recreated the <code>schema.rb</code> file and the schema_info database table via <code>rake db:migrate</code>.</p>
<p>Next I ran the generator:</p>
<pre>$ ./script/generate magic_model</pre>
<p>And we&#8217;re done.</p>
<h3>Coming soon</h3>
<p>The MMG is awesome.</p>
<p>The one major drawback of the MMG is the same drawback of all rails generators: if you want to regenerate your models (say you update your schema via migrations) then you cannot regenerate your model associations and validations without completely recreating the file, thus destroying anything else you wrote. Which is useless.</p>
<p>The world of version control (subversion, cvs, etc etc) already solved this problem: merging. So I&#8217;m investigating adding merging to the rails_generator. That should be neat.</p>
<h3>New Gem Generate to get merging too?</h3>
<p>Currently the newgem command doesn&#8217;t use the rails_generator for creating files. So adding merging to rails_generator won&#8217;t help newgem. That is, unless I rewrite newgem. So, I&#8217;ll look into that too.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/20/newgem-using-rubigen-for-generator-support/' rel='bookmark' title='Permanent Link: NewGem Generator &#8211; now with script/generate'>NewGem Generator &#8211; now with script/generate</a> <small>The New Gem Generator (0.13.0)&#8217;s newgem command now behaves like...</small></li><li><a href='http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/' rel='bookmark' title='Permanent Link: Magic Wiggly Lines => GuessMethod, by Chris Shea'>Magic Wiggly Lines => GuessMethod, by Chris Shea</a> <small>If you ever make time to code just for pleasure,...</small></li><li><a href='http://drnicwilliams.com/2007/05/27/new-gem-generates-gets-rspec-video/' rel='bookmark' title='Permanent Link: New Gem Generator gets RSpec [video]'>New Gem Generator gets RSpec [video]</a> <small> One day you will be able to write a...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/05/23/dr-nics-magic-show-at-rejectconf2007/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
