<?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>P(failure &#124; big_shot_present) = .9</title>
	<atom:link href="http://blog.e-thang.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.e-thang.net</link>
	<description>If even 1 person reads this, I will consider that a success</description>
	<lastBuildDate>Thu, 24 Jun 2010 14:49:04 +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>Rails + WordPress (at the same time)</title>
		<link>http://blog.e-thang.net/2010/06/01/rails-wordpress-at-the-same-time/</link>
		<comments>http://blog.e-thang.net/2010/06/01/rails-wordpress-at-the-same-time/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 13:17:08 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=94</guid>
		<description><![CDATA[It is a Sin to be a &#8220;Rails programmer&#8221; and not use a blogging engine you wrote yourself and especially in Rails, but there are cases when one&#8217;s available time is more important than one&#8217;s soul. This particular case assumes you use shared hosting.  That&#8217;s probably another bad thing, but whatever.  Also, you need access [...]]]></description>
			<content:encoded><![CDATA[<p>It is a Sin to be a &#8220;Rails programmer&#8221; and not use a blogging engine you wrote yourself and especially in Rails, but there are cases when one&#8217;s available time is more important than one&#8217;s soul.</p>
<p>This particular case assumes you use shared hosting.  That&#8217;s probably another bad thing, but whatever.  Also, you need access to your public_html folder&#8217;s .htaccess file.  In fact, this whole setup is so host-specific that you might find it worthless.</p>
<p>Starting over.  Shared host.  public_html folder. Apache. Your host routes traffic to your app by rewriting your requests via a proxy to a specific port.</p>
<p>Now let&#8217;s say you have the domain www.domain.com.  Your host does something like:</p>
<pre>RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$

RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12%{REQUEST_URI}" [P,QSA,L]</pre>
<p>Note: port numbers have been changed to protect the innocent.</p>
<p>This basically just says &#8220;if a request hits me and the host matches your domain, I&#8217;m gong to proxy it on to myself on a different port.&#8221;  The webserver runs a request against itself on a different port, which presumably is picked up by whatever handles your Rails application.</p>
<p>Well, you want your blog to be at http://www.domain.com/blog.  That unfortunately does contain your domain in the HTTP_HOST.  Which means Rails will try to serve up your blog.  Which means it will fail or, if you actually have your blog in your app&#8217;s public folder, will serve up your .php files as raw text downloads.</p>
<p>Solution:</p>
<pre>RewriteCond %{REQUEST_URI} !^/blog/(.*)$
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12%{REQUEST_URI}" [P,QSA,L]</pre>
<p>We add an additional condition to our rewrite requiring that the actual path requested (Apache&#8217;s REQUEST_URI expands to that) NOT match &#8220;/blog/&#8221; followed by pretty much anything.  This will get your webserver to handle all of these requests as if your Rails app weren&#8217;t there, which is what you&#8217;re going for anyway.</p>
<p>This isn&#8217;t limited to WordPress.  And note that whatever you are trying to run needs to be in your Apache DOCUMENT_ROOT folder.  That could be like &#8220;public_html&#8221; or something.  I don&#8217;t know the answer to that for you.  You CAN work around that with other directives, but that is beyond the scope of this entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2010/06/01/rails-wordpress-at-the-same-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When having trouble installing the mysql gem on OSX</title>
		<link>http://blog.e-thang.net/2010/04/21/when-having-trouble-installing-the-mysql-gem-on-osx/</link>
		<comments>http://blog.e-thang.net/2010/04/21/when-having-trouble-installing-the-mysql-gem-on-osx/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 18:33:09 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mysql gem]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=89</guid>
		<description><![CDATA[And you get an error like: *** extconf.rb failed *** Go read: http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed]]></description>
			<content:encoded><![CDATA[<p>And you get an error like:</p>
<p>*** extconf.rb failed ***</p>
<p>Go read:</p>
<p><a href="http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed" onclick="javascript:pageTracker._trackPageview('/outbound/article/blog.bmn.name');">http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2010/04/21/when-having-trouble-installing-the-mysql-gem-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run OS X in one language but certain apps in another</title>
		<link>http://blog.e-thang.net/2010/04/20/how-to-run-os-x-in-one-language-but-certain-apps-in-another/</link>
		<comments>http://blog.e-thang.net/2010/04/20/how-to-run-os-x-in-one-language-but-certain-apps-in-another/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 13:14:50 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[french]]></category>
		<category><![CDATA[pages]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=84</guid>
		<description><![CDATA[Ever want to run your OS in French but you live in America and type mostly in English? http://www.tj-hd.co.uk/en-gb/languageswitcher/ Because if you want to use more than one language at a time on your computer you&#8217;re Doing It Wrong, because if you were doing it right, Apple would have provided a way to do it [...]]]></description>
			<content:encoded><![CDATA[<p>Ever want to run your OS in French but you live in America and type mostly in English?</p>
<p><a href="http://www.tj-hd.co.uk/en-gb/languageswitcher/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.tj-hd.co.uk');">http://www.tj-hd.co.uk/en-gb/languageswitcher/</a></p>
<p>Because if you want to use more than one language at a time on your computer you&#8217;re Doing It Wrong, because if you were doing it right, Apple would have provided a way to do it that way.</p>
<p>Astounding that this requires a 3rd-party application. Yes, it is possible to change the language in your document, but if you also use paragraph styles, they have a set languge.  And that set language doesn&#8217;t change when you set the language on the whole document.  And you can&#8217;t highlight the whole document of mixed languages and set the whole thing to one of them.  Usability at its finest.</p>
<p>Apple, some computer users do know how to operate computers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2010/04/20/how-to-run-os-x-in-one-language-but-certain-apps-in-another/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.5 doesn&#8217;t play well with Rack 1.1.0</title>
		<link>http://blog.e-thang.net/2010/02/16/rails-2-3-5-doesnt-play-well-with-rack-1-1-0/</link>
		<comments>http://blog.e-thang.net/2010/02/16/rails-2-3-5-doesnt-play-well-with-rack-1-1-0/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 11:59:46 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=76</guid>
		<description><![CDATA[Ever get this gem when running a Rails 2.3.5 application with Thin? /Users//config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': can't activate rack (~&#62; 1.0.1, runtime) for [], already activated rack-1.1.0 for ["thin-1.0.0"] (RuntimeError) from /Users//config/../vendor/rails/railties/lib/initializer.rb:134:in `process' from /Users//config/../vendor/rails/railties/lib/initializer.rb:113:in `send' from /Users//config/../vendor/rails/railties/lib/initializer.rb:113:in `run' from /Users//config/environment.rb:13 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/rack/adapter/rails.rb:31:in `load_application' from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/rack/adapter/rails.rb:23:in `initialize' ... 6 levels... from [...]]]></description>
			<content:encoded><![CDATA[<p>Ever get this gem when running a Rails 2.3.5 application with Thin?</p>
<p><code>/Users//config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': can't activate rack (~&gt; 1.0.1, runtime) for [], already activated rack-1.1.0 for ["thin-1.0.0"] (RuntimeError)<br />
from /Users//config/../vendor/rails/railties/lib/initializer.rb:134:in `process'<br />
from /Users//config/../vendor/rails/railties/lib/initializer.rb:113:in `send'<br />
from /Users//config/../vendor/rails/railties/lib/initializer.rb:113:in `run'<br />
from /Users//config/environment.rb:13<br />
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'<br />
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'<br />
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/rack/adapter/rails.rb:31:in `load_application'<br />
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/rack/adapter/rails.rb:23:in `initialize'<br />
... 6 levels...<br />
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/thin/runner.rb:139:in `run!'<br />
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/bin/thin:6<br />
from /usr/bin/thin:19:in `load'<br />
from /usr/bin/thin:19</code></p>
<p>Disappointing to be sure, but there&#8217;s a simple fix I found <a href="http://www.ruby-forum.com/topic/201603" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ruby-forum.com');">here</a>.  Thin will try to load the latest version of Rack that you have installed, but Rails specifically asks for 1.0.1.  You can&#8217;t have 2 versions of it running at the same time, so RubyGems pukes.</p>
<p>The simple solution is to uninstall Rack 1.1.0.  If that isn&#8217;t an option for you, dang.  There&#8217;s always <a href="https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3685-actionpack-235-gem-declares-incompatibility-with-rack-110" onclick="javascript:pageTracker._trackPageview('/outbound/article/rails.lighthouseapp.com');">this rails ticket</a> you could go fix and make a big name for yourself in the community. <img src='http://blog.e-thang.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2010/02/16/rails-2-3-5-doesnt-play-well-with-rack-1-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to freeze gems in Rails</title>
		<link>http://blog.e-thang.net/2010/02/01/how-to-freeze-gems-in-rails/</link>
		<comments>http://blog.e-thang.net/2010/02/01/how-to-freeze-gems-in-rails/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 12:58:59 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=74</guid>
		<description><![CDATA[http://blog.logeek.fr/2008/12/23/how-to-freeze-gems-with-rails-2-1]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.logeek.fr/2008/12/23/how-to-freeze-gems-with-rails-2-1" onclick="javascript:pageTracker._trackPageview('/outbound/article/blog.logeek.fr');">http://blog.logeek.fr/2008/12/23/how-to-freeze-gems-with-rails-2-1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2010/02/01/how-to-freeze-gems-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paperclip/ImageMagick/RMagick error: &#8220;is not recognized by the &#8216;identify&#8217; command&#8221;</title>
		<link>http://blog.e-thang.net/2009/12/30/paperclipimagemagickrmagick-error-is-not-recognized-by-the-identify-command/</link>
		<comments>http://blog.e-thang.net/2009/12/30/paperclipimagemagickrmagick-error-is-not-recognized-by-the-identify-command/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 04:19:12 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rmagick]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=70</guid>
		<description><![CDATA[If you&#8217;re using the above combination, and you&#8217;re getting the above error, make sure that you&#8217;ve configured Paperclip to find ImageMagick in the right place.  Create an initializer file, RAILS_ROOT/config/intializers/paperclip.rb, and put &#8220;Paperclip.options[:image_magick_path] = &#8216;path/to/image_magic&#8217;&#8221; inside of it.  On Mac or a *nix system, type &#8220;which identify&#8221; to find the right folder. Big thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using the above combination, and you&#8217;re getting the above error, make sure that you&#8217;ve configured Paperclip to find ImageMagick in the right place.  Create an initializer file, RAILS_ROOT/config/intializers/paperclip.rb, and put &#8220;Paperclip.options[:image_magick_path] = &#8216;path/to/image_magic&#8217;&#8221; inside of it.  On Mac or a *nix system, type &#8220;which identify&#8221; to find the right folder.</p>
<p>Big thanks to avit on <a href="http://railsforum.com/viewtopic.php?pid=73000#p73000" onclick="javascript:pageTracker._trackPageview('/outbound/article/railsforum.com');">this forum</a> for the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2009/12/30/paperclipimagemagickrmagick-error-is-not-recognized-by-the-identify-command/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>shoulda and factory_girl not cleaning up db between tests</title>
		<link>http://blog.e-thang.net/2009/12/22/shoulda-and-factory_girl-not-cleaning-up-db-between-tests/</link>
		<comments>http://blog.e-thang.net/2009/12/22/shoulda-and-factory_girl-not-cleaning-up-db-between-tests/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 16:44:08 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=65</guid>
		<description><![CDATA[Wow, this one was a doozy. I recently (yesterday) had my first introduction to shoulda and factory_girl for testing. I&#8217;m torn as to whether or not fixtures are the root of all evil, as I haven&#8217;t really encountered problems with them and find them very simple to use and maintain, but that isn&#8217;t the point [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, this one was a doozy.  I recently (yesterday) had my first introduction to shoulda and factory_girl for testing.  I&#8217;m torn as to whether or not fixtures are the root of all evil, as I haven&#8217;t really encountered problems with them and find them very simple to use and maintain, but that isn&#8217;t the point of this post.</p>
<p>The point is that just starting a new job I figured a good thing to do was first run the unit tests to make sure I had set up the app properly.  I was treated to many failures and investigated why.  I found many failures caused by a polluted database.  Previous tests weren&#8217;t cleaning up after themselves, so later tests had bad state (duplicate records and that sort of thing).  While that may be a plug for database level enforcement of that kind of rule, that task was beyond the scope of what I was doing.</p>
<p>I scoured Google looking for answers, and a day later I finally found it.  Just to stretch you along even further, here&#8217;s what it wasn&#8217;t:</p>
<ul>
<li>shoulda not running implicit teardowns</li>
<li>transactional fixtures being turned off</li>
</ul>
<p>No, it was a great deal dumber than that, and a thanks to Eric Artzt, whoever you are, for <a href="http://groups.google.com/group/shoulda/browse_thread/thread/6bb0c6501a1c0448/98f0de168501607f?hl=en&amp;lnk=gst&amp;q=transactional+fixtures#98f0de168501607f" onclick="javascript:pageTracker._trackPageview('/outbound/article/groups.google.com');">providing the solution</a>.  The table that was giving me fits is a MyISAM table, which doesn&#8217;t support transactions.  Which means there are no rollbacks to clean up my DB state.  Which means I either have to explicitly put calls to do that into an explicity-defined teardown method or switch the engine on the table in question.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2009/12/22/shoulda-and-factory_girl-not-cleaning-up-db-between-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Ruby gems that require building native extensions on Snow Leopard</title>
		<link>http://blog.e-thang.net/2009/12/18/installing-ruby-gems-that-require-building-native-extensions-on-snow-leopard/</link>
		<comments>http://blog.e-thang.net/2009/12/18/installing-ruby-gems-that-require-building-native-extensions-on-snow-leopard/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 19:31:47 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[rant]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=60</guid>
		<description><![CDATA[I haven&#8217;t tested this on all &#8220;machines&#8221; running Snow Leopard, but on the brand new one I had to get today for work, I found that the default Ruby / Gems install doesn&#8217;t support installing gems that require building native extensions. The error message I was treated to contained the following: MacBook-Pro-de-Ethan-Garofolo:~ juanpaco$ sudo gem [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t tested this on all &#8220;machines&#8221; running Snow Leopard, but on the brand new one I had to get today for work, I found that the default Ruby / Gems install doesn&#8217;t support installing gems that require building native extensions.  The error message I was treated to contained the following:</p>
<p><code>MacBook-Pro-de-Ethan-Garofolo:~ juanpaco$ sudo gem install thin<br />
Password:<br />
Building native extensions.  This could take a while...<br />
ERROR:  Error installing thin:<br />
	ERROR: Failed to build gem native extension.<br />
<code><br />
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install thin<br />
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h</p>
<p><code><br />
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10 for inspection.<br />
Results logged to /Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/ext/gem_make.out</p>
<p>The solution was hyper-intuitive.  Install XCode.  Because of course that's the first thing you think of.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2009/12/18/installing-ruby-gems-that-require-building-native-extensions-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Renaming a database in Rails</title>
		<link>http://blog.e-thang.net/2009/12/14/renaming-a-database-in-rails/</link>
		<comments>http://blog.e-thang.net/2009/12/14/renaming-a-database-in-rails/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 17:09:15 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[myql]]></category>
		<category><![CDATA[rename database]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=54</guid>
		<description><![CDATA[Hooray for a non-rant post! The heart of this method works outside of Rails, but there&#8217;s one particular convenience method that Rails provides.  Find some way to mimic that behavior, and the rest would apply.  Also, this is a MySQL-specific solution.  I haven&#8217;t tried it with any other DB systems. We &#8220;rename&#8221; a database by [...]]]></description>
			<content:encoded><![CDATA[<p>Hooray for a non-rant post!</p>
<p>The heart of this method works outside of Rails, but there&#8217;s one particular convenience method that Rails provides.  Find some way to mimic that behavior, and the rest would apply.  Also, this is a MySQL-specific solution.  I haven&#8217;t tried it with any other DB systems.</p>
<p>We &#8220;rename&#8221; a database by moving all of its tables into a new database.  We do so via <a title="MySQL RENAME TABLE Syntax" href="http://dev.mysql.com/doc/refman/5.0/en/rename-table.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/dev.mysql.com');">MySQL&#8217;s RENAME TABLE command</a>.  Basically, create an empty database with the new name.  We then use our ActiveRecord connection&#8217;s &#8220;tables&#8221; method to loop over all the tables in our database, executing a RENAME TABLE from the old to the new with each iteration.  &#8220;Tables&#8221; is the convenience method I mentioned above. Encapsulating this in a method we get:</p>
<pre>def rename_database(old_db_name, new_db_name)
    ActiveRecord::Base.connection.execute "CREATE DATABASE #{new_db_name}"
    ActiveRecord::Base.connection.tables.each do |table|
        ActiveRecord::Base.connection.execute
            "RENAME TABLE #{old_db_name}.#{table} TO #{new_db_name}.#{table}"
    end
    ActiveRecord::Base.connection.execute "DROP DATABASE #{old_db_name}"
end</pre>
<p>Error checking is left as an (important!) exercise to the reader.  Also, you may prefer to monkey patch this into ActiveRecord itself as opposed to some odd method floating around in global space.</p>
<p>This presupposes that the new database destination will be on the same server.</p>
<p>Another way to rename a database is to mysqldump the old one to a file and then reimport it to the renamed database.  The method presented in this article is advantageous if your database has a large amount of data.  Renaming a table is almost instant.  <strong>Dumping millions of rows and reimporting them is not so instant.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2009/12/14/renaming-a-database-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SubSonic Post 1</title>
		<link>http://blog.e-thang.net/2009/11/29/subsonic-post-1/</link>
		<comments>http://blog.e-thang.net/2009/11/29/subsonic-post-1/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 12:13:52 +0000</pubDate>
		<dc:creator>e-thang</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://blog.e-thang.net/?p=51</guid>
		<description><![CDATA[I&#8217;m trying out SubSonic for my personal finance management tool, Budgeteer, that I&#8217;m creating.  The experience thus far has been frustrating. I&#8217;m quite keen on straightforward documentation.  The creators of SubSonic are not.  They are quite keen of being &#8220;clever.&#8221; Take for example the first bit you&#8217;re likely to read at SubSonic&#8217;s webpage, bit which [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying out <a title="SubSonic website" href="http://subsonicproject.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/subsonicproject.com');">SubSonic</a> for my personal finance management tool, <a title="Budgeteer at GitHub" href="http://wiki.github.com/juanpaco/budgeteer/" onclick="javascript:pageTracker._trackPageview('/outbound/article/wiki.github.com');">Budgeteer</a>, that I&#8217;m creating.  The experience thus far has been frustrating. I&#8217;m quite keen on straightforward documentation.  The creators of SubSonic are not.  They are quite keen of being &#8220;clever.&#8221;</p>
<p>Take for example the first bit you&#8217;re likely to read at SubSonic&#8217;s webpage, bit which I presume is meant to explain what SubSonic does.  &#8220;<span>SubSonic is</span> A Super High-fidelity Batman Utility Belt that works up your Data Access&#8230;&#8221;  I like Batman, especially since Christopher Nolan rebooted the franchise.  But I don&#8217;t care about Batman with relation to software projects.  I still don&#8217;t really know what SubSonic is after having read that.  Is it an ORM?  Is it a set of functions similar to MySQL access in PHP?  I don&#8217;t know, and they don&#8217;t seem to want to tell me.</p>
<p>I can stomach cleverness to about the same degree I can stomach horseradish.  It ought to enhance the content, and it can in the <a title="Example of where cleverness works" href="http://www.sourcetext.com/grammarian/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.sourcetext.com');">right hands</a>.  The SubSonic authors WAY overdo it, and their writing style hides all the content behind a shroud of utter nonsense.  Hopefully they code better than they write English (a common engineering foible shared by this author as well).</p>
<p>They also use a LOT of screencasts.  Screencasts have their place, when done well (<a href="http://railscasts.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/railscasts.com');">example</a>).  However, the 1 that I&#8217;ve looked into up to this point goes on about how easy it is to set up SubSonic while scrolling past the code the author is adding after about 1 second.  Screencasts don&#8217;t have the best pause mechanism, so it&#8217; s pretty easy to miss what the author is typing.  You also can&#8217;t copy/paste from a screencast.</p>
<p>More will follow.  Since there isn&#8217;t actually anything useful on how to set SubSonic up in a client application, and that&#8217;s what I&#8217;m writing, I&#8217;ll do that once and if I figure it out.  The frustration had risen to a point where I needed to vent, and where better than the solitude of a blog?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.e-thang.net/2009/11/29/subsonic-post-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
