<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>neutron flux</title>
	
	<link>http://www.neutronflux.net</link>
	<description>blah, programming, blah, ruby, blah, rails, blah, things that interest me</description>
	<pubDate>Thu, 20 Aug 2009 15:37:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/neutronflux" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="neutronflux" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Shoulda Snippets for Emacs</title>
		<link>http://www.neutronflux.net/2009/07/28/shoulda-snippets-for-emacs/</link>
		<comments>http://www.neutronflux.net/2009/07/28/shoulda-snippets-for-emacs/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 05:08:57 +0000</pubDate>
		<dc:creator>rwc9u</dc:creator>
		
		<category><![CDATA[emacs]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.neutronflux.net/?p=53</guid>
		<description><![CDATA[	I have just updated my Shoulda snippets for the Emacs YASnippets templating package. Shoulda is a ruby-based testing framework that consists of test macros, assertions, and helpers added on to the Test::Unit ruby framework. The snippets are based, and in many cases copied from the TextMate Shoulda snippet bundle, and modified where needed to work [...]]]></description>
			<content:encoded><![CDATA[	<p>I have just updated my <a href="http://github.com/rwc9u/yasnippets-shoulda/tree/master">Shoulda snippets</a> for the Emacs <a href="http://yasnippet.googlecode.com/svn/trunk/doc/index.html">YASnippets templating package</a>. <a href="http://thoughtbot.com/projects/shoulda/">Shoulda</a> is a ruby-based testing framework that consists of test macros, assertions, and helpers added on to the Test::Unit ruby framework. The snippets are based, and in many cases copied from the <a href="http://svn.textmate.org/trunk/Review/Bundles/Ruby%20Shoulda.tmbundle/">TextMate Shoulda snippet bundle</a>, and modified where needed to work with the YASnippets package. New features in the recently released 0.6beta of YASnippet allow support for more of the TextMate-based snippets. The new YASnippet functionality is discussed in more detail in a post I did on <a href="http://www.emacsblog.org/2009/07/27/yasnippet-updated-supports-nested-placeholders-and-more/">Emacs Blog</a>. </p>
	<p>In order to port many of the snippets over from the TextMate bundle I wrote a <a href="http://gist.github.com/154445">script</a> that automates the process. There is a <a href="http://code.nokrev.com/?p=snippet-copier.git;a=blob_plain;f=snippet_copier.py">Python script</a> that does something very similar. The writing of my script was more of just a code kata for me, so take a look at both. One may be more suitable for your needs. </p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.neutronflux.net/2009/07/28/shoulda-snippets-for-emacs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Better Oracle Support For db:structure:dump</title>
		<link>http://www.neutronflux.net/2009/02/23/better-oracle-support-for-dbstructuredump/</link>
		<comments>http://www.neutronflux.net/2009/02/23/better-oracle-support-for-dbstructuredump/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 07:09:56 +0000</pubDate>
		<dc:creator>rwc9u</dc:creator>
		
		<category><![CDATA[oracle]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.neutronflux.net/?p=33</guid>
		<description><![CDATA[	If you have tried

$ rake db:structure:dump

	in a rails app when using Oracle as your database, then you have probably been slightly disappointed. The same rake task for MySQL and Postgres dumps everything you need to recreate the database. The task for Oracle only dumps SQL for the table creation (no constraints), and for the sequences. [...]]]></description>
			<content:encoded><![CDATA[	<p>If you have tried</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family:monospace;">$ rake db:structure:dump</pre></div></div>

	<p>in a rails app when using Oracle as your database, then you have probably been slightly disappointed. The same rake task for MySQL and Postgres dumps everything you need to recreate the database. The task for Oracle only dumps SQL for the table creation (no constraints), and for the sequences. The <a href="http://github.com/eyestreet/active_record_oracle_extensions/tree/master">active_record_oracle_extensions</a> plug now supports dumping sql for the following:<br />
<ul><li>primary keys</li><li>indexes</li><li>foreign keys</li><li>synonyms</li></ul><br />
I have added enough functionality to scratch my itch. If you need something else or find a bug let me know.</p>


 ]]></content:encoded>
			<wfw:commentRss>http://www.neutronflux.net/2009/02/23/better-oracle-support-for-dbstructuredump/feed/</wfw:commentRss>
		</item>
		<item>
		<title>active_record_oracle_extensions Plugin</title>
		<link>http://www.neutronflux.net/2009/01/02/active_record_oracle_extensions-plugin/</link>
		<comments>http://www.neutronflux.net/2009/01/02/active_record_oracle_extensions-plugin/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 20:12:46 +0000</pubDate>
		<dc:creator>rwc9u</dc:creator>
		
		<category><![CDATA[oracle]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://christiefamily.net/?p=1</guid>
		<description><![CDATA[	The active_record_oracle_extensions plugin provides support for adding foreign keys to migrations, adding synonyms to migrations, and disabling foreign key constraints during fixture loading. These are features that I needed in my applications, but either did not exist in other plugins, or the plugins seem to have been abandoned.
	Installing into a Rails app

$ script/plugin install git://github.com/eyestreet/active_record_oracle_extensions.git

	Adding [...]]]></description>
			<content:encoded><![CDATA[	<p>The <a href="http://github.com/eyestreet/active_record_oracle_extensions/tree/master">active_record_oracle_extensions plugin</a> provides support for adding foreign keys to migrations, adding synonyms to migrations, and disabling foreign key constraints during fixture loading. These are features that I needed in my applications, but either did not exist in other plugins, or the plugins seem to have been abandoned.</p>
	<h3>Installing into a Rails app</h3>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family:monospace;">$ script/plugin install git://github.com/eyestreet/active_record_oracle_extensions.git</pre></div></div>

	<h3>Adding Foreign Keys In a Migration</h3>
	<p>The example below shows a snippet from a migration that adds a foreign key.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span>
    create_table <span style="color:#ff3333; font-weight:bold;">:assets</span>, <span style="color:#ff3333; font-weight:bold;">:force</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
      t.<span style="color:#CC0066; font-weight:bold;">integer</span> <span style="color:#ff3333; font-weight:bold;">:media_record_id</span>
      t.<span style="color:#CC0066; font-weight:bold;">string</span>  <span style="color:#ff3333; font-weight:bold;">:media_file_name</span>
      t.<span style="color:#CC0066; font-weight:bold;">string</span>  <span style="color:#ff3333; font-weight:bold;">:media_content_type</span>
      t.<span style="color:#CC0066; font-weight:bold;">integer</span> <span style="color:#ff3333; font-weight:bold;">:media_file_size</span>
      t.<span style="color:#9900CC;">datetime</span> <span style="color:#ff3333; font-weight:bold;">:media_updated_at</span>
      t.<span style="color:#9900CC;">timestamps</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
    add_foreign_key_constraint <span style="color:#ff3333; font-weight:bold;">:assets</span>, <span style="color:#ff3333; font-weight:bold;">:media_record_id</span>, 
                                        <span style="color:#ff3333; font-weight:bold;">:media_records</span>, <span style="color:#ff3333; font-weight:bold;">:id</span>
 <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

	<h3>Adding a Synonym in Migration</h3>
	<p>The example below shows the creation of a synonym named events for other_user.events. The force option adds &#8220;or replace&#8221; to the sql that generates the synonym. It is assumed that the user under which your are creating the synonym already has the needed grants to allow the creation of the synonym on other_user.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">add_synonym <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:other_user</span>, <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:force</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span></pre></div></div>

	<h3>Disabling Constraints During Fixture Loading</h3>
	<p>If you are using sys or system as your user for your rails application, then <strong>do not use this plugin</strong>, or use it at your own risk. During fixture loading, this plugin disables constraints for the user that has established the connection to oracle, and then re-enables the constraints after the load. </p>


 ]]></content:encoded>
			<wfw:commentRss>http://www.neutronflux.net/2009/01/02/active_record_oracle_extensions-plugin/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
