<?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>databasically // Kansas City Small Business IT &#38;&#38; Ruby on Rails Programming &#187; Programming</title>
	<atom:link href="http://databasically.com/category/blog/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://databasically.com</link>
	<description>Kansas City Small Business IT</description>
	<lastBuildDate>Fri, 20 Apr 2012 04:38:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Lowdown is now free and open-source</title>
		<link>http://databasically.com/2012/04/09/lowdown-is-now-free-and-open-source/</link>
		<comments>http://databasically.com/2012/04/09/lowdown-is-now-free-and-open-source/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 19:16:03 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=657</guid>
		<description><![CDATA[Lowdown is now open-source]]></description>
			<content:encoded><![CDATA[<p>Lowdown was a Rails Rumble project in 2009, aiming to help business owners that want custom software work with developers and designers to get on the same page.</p>
<p>We continued to maintain Lowdown after Rails Rumble, but it&#8217;s time to let it go live its own life.</p>
<p>So, as of today: </p>
<ol>
<li>Lowdown is now 100% free with unlimited projects and unlimited collaborators. All current and paid subscribers have been converted to the free plan. </li>
<li>Lowdown is now Open Source Software. For more information please visit:  <a href="http://github.com/databasically/lowdown">http://github.com/databasically/lowdown</a></li>
<li>Support for the free hosted version has moved to Github issues. Please see #2 for more information. </li>
<li>We&#8217;ve migrated Lowdown to Heroku. All current projects will be intact, although there may be minor (if any) disruption in service as DNS propagates. Thanks for your patience.</li>
</ol>
<p>Thanks for trying/using Lowdown! If you&#8217;re interested in participating in the OS version, please contact us: <a href="http://twitter.com/databasically">@databasically</a></p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2012/04/09/lowdown-is-now-free-and-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bundler 1.1 vs 1.0 install speedup</title>
		<link>http://databasically.com/2012/03/08/bundler-1-1-vs-1-0-install-speedup/</link>
		<comments>http://databasically.com/2012/03/08/bundler-1-1-vs-1-0-install-speedup/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 20:11:57 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=646</guid>
		<description><![CDATA[Bundler 1.1 went official yesterday.  One of the big improvements is speed.  Previous versions of bundler would need to download all of the rubygems information in order to build a dependency tree. Whenever you see Fetching source index for http://rubygems.org/ when you do a bundle install, that&#8217;s bundler downloading the file with all of the gems&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gembundler.com/">Bundler</a> 1.1 went official yesterday.  One of the big improvements is speed.  Previous versions of bundler would need to download all of the rubygems information in order to build a dependency tree.</p>
<p>Whenever you see <code>Fetching source index for http://rubygems.org/</code> when you do a <code>bundle install</code>, that&#8217;s bundler downloading the file with all of the gems&#8217; information.</p>
<p>Now, bundler 1.1 is smarter about this.  It can ask rubygems.org directly to give it the dependencies for a list of gems (see this post for a better explanation of the actual <a href="http://patshaughnessy.net/2011/10/14/why-bundler-1-1-will-be-much-faster">rubygems bundler API calls</a>) and use that to start downloading the gems.</p>
<p>Here are my results, for a project with a brand new empty gemset:</p>
<pre name="code" class="ruby">
$ gem install bundler -v=1.0.18 &#038;&#038; time bundle install
Installing ...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

real	48.174s
user	38.411s
sys	19.535s

$ gem install bundler -v=1.1.0 &#038;&#038; time bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

real	22.015s
user	28.377s
sys	18.442s
</pre>
<p>Speedy!</p>
<p>Check out the <code>bundle install --verbose</code> option if you want more insight into what bundler is doing, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2012/03/08/bundler-1-1-vs-1-0-install-speedup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kansas City Ruby:  What&#8217;s New in Ruby &#8211; February 2012</title>
		<link>http://databasically.com/2012/02/22/kansas-city-ruby-whats-new-in-ruby-february-2012/</link>
		<comments>http://databasically.com/2012/02/22/kansas-city-ruby-whats-new-in-ruby-february-2012/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 01:36:55 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Kansas City]]></category>
		<category><![CDATA[Kansas City Ruby User Group]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=639</guid>
		<description><![CDATA[At the beginning of each Kansas City Ruby meeting, I do a quick presentation on some new neat things from the last month in Ruby news. &#160; What&#8217;s New In Ruby February 2012 Ruby on Rails 3.2 released http://weblog.rubyonrails.org/ Faster development mode End of Ruby 1.8.7 puts Person.active.limit(5).explain Automatically shows when &#62; half a second [...]]]></description>
			<content:encoded><![CDATA[<p>At the beginning of each Kansas City Ruby meeting, I do a quick presentation on some new neat things from the last month in Ruby news.</p>
<p><iframe src="https://docs.google.com/present/embed?id=dgw9ksj_1cbtfshfp&amp;autoStart=true&amp;loop=true" frameborder="0" width="410" height="342"></iframe></p>
<p>&nbsp;</p>
<h2>What&#8217;s New In Ruby</h2>
<h3>February 2012</h3>
<h4>Ruby on Rails 3.2 released</h4>
<p><a href="http://weblog.rubyonrails.org/">http://weblog.rubyonrails.org/</a></p>
<ul>
<li>Faster development mode</li>
<li>End of Ruby 1.8.7</li>
<li>
<pre>puts Person.active.limit(5).explain</pre>
</li>
<li>Automatically shows when &gt; half a second</li>
<li>TaggedLogger</li>
</ul>
<h4></h4>
<h4>ActiveRecord Store</h4>
<pre>class User &lt; ActiveRecord::Base
  store :settings, accessors: [ :color, :homepage ]
end</pre>
<pre>u = User.new(color: 'black', homepage: '37signals.com')
u.color # Accessor stored attribute</pre>
<pre>  # Any attribute, even if not specified with an accessor
u.settings[:country] = 'Denmark'</pre>
<h3>RubyMine 4.0 released</h3>
<p><a href="http://blog.jetbrains.com/ruby/2012/02/rubymine-4-is-here-to-make-you-feel-the-productivity/">http://blog.jetbrains.com/ruby/2012/02/rubymine-4-is-here-to-make-you-feel-the-productivity/</a></p>
<p>RubyMine is a popular Ruby and Rails IDE by JetBrains (the folks behind IntelliJ IDEA).</p>
<p>A focus has been put on improving its performance and UI, but it now also supports all of Rails 3.2 features, including CoffeeScript compilation right from the IDE.</p>
<h3>Spree 1.0 Released</h3>
<p><a href="http://spreecommerce.com/">http://spreecommerce.com/</a></p>
<p>Spree is almost certainly the most popular, fully featured Rails-based e-commerce system and its creators are proud to announce the release of version 1.0.0.</p>
<h3>Strano</h3>
<p><a href="https://github.com/joelmoss/strano">https://github.com/joelmoss/strano</a><br />
The Github backed Capistrano deployment management UI.</p>
<h3>Guard::RSpectacle</h3>
<p><a href="https://github.com/netzpirat/guard-rspectacle">https://github.com/netzpirat/guard-rspectacle</a><br />
Guard::RSpectacle automatically tests your application with RSpec when files are modified.</p>
<h3>Lightning Talks</h3>
<ul>
<li>Samuel Mullen: using search provider shortcuts in Google Chrome, <a href="http://samuelmullen.com/2012/02/power-up-search-in-google-chrome/">blog post</a></li>
<li>Jaime Bellmyer: searching with <a href="http://leap2.com/">leap2</a></li>
<li>Advanced REST Client: help view API responses with Chrome app <a href="https://chrome.google.com/webstore/detail/hgmloofddffdnphfgcellkdfbfbjeloo">link</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2012/02/22/kansas-city-ruby-whats-new-in-ruby-february-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration for mailjet email delivery with Ruby on Rails</title>
		<link>http://databasically.com/2011/06/07/configuration-for-mailjet-email-delivery-with-ruby-on-rails/</link>
		<comments>http://databasically.com/2011/06/07/configuration-for-mailjet-email-delivery-with-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 10:00:03 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=583</guid>
		<description><![CDATA[Setting up mailjet.com to deliver your mail via Ruby on Rails? Here&#8217;s how, because their Getting Started is nothing but placeholder headers right now. Create an account Go to https://www.mailjet.com and create an account. Note: the word &#8220;Faculatative&#8221; means &#8220;optional&#8221; on the signup form. Add your sending address Add a sending address (Accounts > Sender [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up mailjet.com to deliver your mail via Ruby on Rails?  Here&#8217;s how, because their <a href="https://www.mailjet.com/docs/getting_started">Getting Started</a> is nothing but placeholder headers right now.</p>
<div class="thumbnail"><a href="https://skitch.com/wesg/fdkc8/mailjet-real-time-emailing-mailjet.com"><img src="https://img.skitch.com/20110607-bmbfb3f4pjrcawsya4yab9dcic.preview.jpg" alt="Mailjet : Real-time Emailing - mailjet.com" /></a></div>
</p>
<p><span id="more-583"></span><br />
<h2>Create an account</h2>
<p>Go to <a href="https://www.mailjet.com">https://www.mailjet.com</a> and create an account.</p>
<p>Note: the word &#8220;Faculatative&#8221; means &#8220;optional&#8221; on the signup form.</p>
<h2>Add your sending address</h2>
<ul>
<li>Add a sending address (Accounts > <a href="https://www.mailjet.com/account/sender">Sender Addresses</a>)</li>
<li>Update your Rails ActionMailer configuration
<ul>
<li>Find the settings you need at: <a href="https://www.mailjet.com/account/setup">https://www.mailjet.com/account/setup</a></p>
<pre>
    SMTP server:
    in.mailjet.com

    Username (API Key):
    12345678901234567890

    Password (Secret Key):
    99999999999999999999999999999999

    Port:
    25 or 587 (some providers block port 25)

    Use TLS:
    yes
  </pre>
</li>
<li>Set these settings in config/application.rb (or config/environments/production.rb):
<pre name="code" class="ruby">

    config.action_mailer.raise_delivery_errors = false
    config.action_mailer.perform_deliveries = true

    config.action_mailer.smtp_settings = {
      :address => "in.mailjet.com",
      :enable_starttls_auto => true,
      :port => 587,
      :authentication => 'plain',
      :user_name => "12345678901234567890",
      :password => "99999999999999999999999999999999"
    }
</pre>
</li>
</ul>
</li>
</ul>
<h2>Setup domain authentication (SPF and/or DomainKeys/DKIM)</h2>
<h3>SPF</h3>
<p>
  <img src="https://img.skitch.com/20110607-nmn91j4ukdp8yna3pup3qu1sb8.png" alt="My Account - mailjet.com" /><br />
  Click <b>Domain DNS and SMTP setup</b>.<br />
  Then, under <b>Domain Authentication</b>, click your domain.
</p>
<p>Setting up SPF requires adding a DNS entry. Mailjet will look at your existing one and give you the one to replace it with.<br />
  It&#8217;ll look something like: <br /><code>domainname.com.	IN TXT "v=spf1 include:spf.mailjet.com mx ~all"</code><br />
  In my DNS manager, I created a TXT record, gave it a name of &#8220;domainname.com.&#8221; and set the value to the <br /><code>'v=spf1 include:spf.mailjet.com mx ~all'</code> portion (without the quotes).  The full example they give you is for the DNS zone syntax, which you may or may not have.</p>
<p>  If you need help configuring this, <a href="/contact-us">we would be happy to help you</a>.</p>
<h3>DKIM</h3>
<p>
  This is similar, a TXT record that has a key that identifies your server so mail can be sent.  Same deal.
</p>
<h2>Test</h2>
<p>Deploy your changes and kick off something that sends a mailer.  We have a Notifier model that has a <code>test_email()</code> method that I just called from the console to push a test through.  I just went to the reports and saw it there.</p>
<p>All in all, the service seems a little rough around the edges, mostly due to it being a French company that could use a little work on the translations and some serious love on the support documentations.  Hope this helps you get started with Mailjet configuration!</p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/06/07/configuration-for-mailjet-email-delivery-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git: merge a single commit</title>
		<link>http://databasically.com/2011/06/03/git-merge-a-single-commit/</link>
		<comments>http://databasically.com/2011/06/03/git-merge-a-single-commit/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 10:01:43 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=563</guid>
		<description><![CDATA[Sometimes, you have one commit you want to get into production, but it&#8217;s located after other changes that you&#8217;re not ready to merge in yet. How can you get that single git commit into a different branch? First, you have to know the SHA of the commit you want: git checkout branch-with-commit-on-it git log Highlight [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you have one commit you want to get into production, but it&#8217;s located after other changes that you&#8217;re not ready to merge in yet.  How can you get that single git commit into a different branch?</p>
<p>First, you have to know the SHA of the commit you want:</p>
<pre class="ruby">  git checkout branch-with-commit-on-it
  git log</pre>
<p>Highlight and copy the SHA of the commit you want to grab.</p>
<pre class="ruby">  git checkout master

  # -n =&gt; don't commit, just merge changes so we can review and commit ourself
  git cherry-pick -n [The commit’s SHA-1 Hash]

  # review
  git diff –cached

  # commit if all is well
  git commit -a -m “merge SHA1 ..."</pre>
<p>If you&#8217;re feeling confident, you can skip the -n and merge the single commit in directly and save a minute.</p>
<p>Note, this isn&#8217;t a merge, so it&#8217;s possible you could have some conflicts down the road when you merge the original commit into this branch.  You&#8217;re creating a brand new commit object.</p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/06/03/git-merge-a-single-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby&#8217;s ParseExcel and the Extra Date</title>
		<link>http://databasically.com/2011/04/22/rubys-parseexcel-and-the-extra-date/</link>
		<comments>http://databasically.com/2011/04/22/rubys-parseexcel-and-the-extra-date/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 15:55:15 +0000</pubDate>
		<dc:creator>Samuel Mullen</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=533</guid>
		<description><![CDATA[We have a feature in one of our application which allows the user to upload data from an Excel spreadsheet. One of the columns read in is a date field. Because we&#8217;re dealing with end users, sometimes those dates come in as &#8220;Date&#8221; objects, sometimes they come in as &#8220;String&#8221;s, and sometimes they come in [...]]]></description>
			<content:encoded><![CDATA[<p>We have a feature in one of our application which allows the user to upload data from an Excel spreadsheet. One of the columns read in is a date field. Because we&#8217;re dealing with end users, sometimes those dates come in as &#8220;Date&#8221; objects, sometimes they come in as &#8220;String&#8221;s, and sometimes they come in as a number.</p>
<p>When Excel saves a date as a numeric, it is that value&#8217;s number of days since January 0, 1900 (No, we can&#8217;t say Dec 31, 1899). So a spreadsheet would store &#8220;May 1, 2011&#8243; as 40664 if it was formatted as a number.</p>
<p>That&#8217;s great, peachy even, but if you&#8217;ll notice, 40664 days from Dec 31, 1899 is May 2, 2011, not May 1st. What happened? Compatibility.</p>
<p>When Microsoft introduced Excel way back when, Lotus123 dominated the spreadsheet marking. In order for Microsoft to be able to compete, it had to be compatible with Lotus123. It had to be compatible with all the formulas, all the features, and all the bugs. One of those bugs had to do with an erroneous leap day in 1900. This means that when you read in numbers from a spreadsheet in order to translate them to a date, you have to account for that extra leap day.</p>
<p>The solution? Just subtract one from the numeric. It might look something like this (from the Rails console):</p>
<pre name='code' class="ruby">Date.civil(1899, 12, 31) + 40664.days - 1.day</pre>
<p>We could have did that anyway and just chalked it up to something weird, but now, at least, we know why it&#8217;s weird.</p>
<p><strong>Notes:</strong></p>
<ul>
<li>OpenOffice is also fully compatible with that bug.</li>
<li><a href="http://www.cpearson.com/excel/datetime.htm">Dates and Times in Excel</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/04/22/rubys-parseexcel-and-the-extra-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gateway timeout with nginx/passenger standalone</title>
		<link>http://databasically.com/2011/04/18/gateway-timeout-with-nginxpassenger-standalone/</link>
		<comments>http://databasically.com/2011/04/18/gateway-timeout-with-nginxpassenger-standalone/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 15:18:52 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=528</guid>
		<description><![CDATA[I needed to run Rails apps with both ruby 1.8.7 and 1.9.2 on the same server. Passenger Standalone to the rescue! Setting up my 1.9.2 app as a standalone server and setting it up as proxy to it worked great. Until we had to upload and process some files. Turns out, the gateway server would [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to run Rails apps with both ruby 1.8.7 and 1.9.2 on the same server.</p>
<p><a href="http://www.modrails.com/documentation/Users%20guide%20Standalone.html">Passenger Standalone</a> to the rescue!  Setting up my 1.9.2 app as a standalone server and setting it up as proxy to it worked great.</p>
<p><strong>Until</strong> we had to upload and process some files.  Turns out, the gateway server would timeout, even though the process was still processing on the app server.</p>
<p>The proxing nginx server would reply with &#8220;Gateway Timeout 504&#8243;.</p>
<p>The fix from the nginx documentation: <a href="http://wiki.nginx.org/HttpProxyModule#proxy_read_timeout">proxy_read_timeout</a></p>
<p>My proxy config after this:</p>
<pre name="code" class="ruby">
  location / {
    proxy_pass http://127.0.0.1:3010;
    proxy_read_timeout 240s;
  }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/04/18/gateway-timeout-with-nginxpassenger-standalone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git: Commit Early, Commit Often</title>
		<link>http://databasically.com/2011/03/14/git-commit-early-commit-often/</link>
		<comments>http://databasically.com/2011/03/14/git-commit-early-commit-often/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 16:28:36 +0000</pubDate>
		<dc:creator>Jaime Bellmyer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=486</guid>
		<description><![CDATA[Don&#8217;t Be Afraid of Commitment The phrase &#8220;save early, save often&#8221; was a mantra of early computer science. It&#8217;s good advice, but it&#8217;s only half the story. If you&#8217;ve ever sat down for a fast and furious coding session only to realize hours later that you removed something important, you know the frustration of not [...]]]></description>
			<content:encoded><![CDATA[<h2>Don&#8217;t Be Afraid of Commitment</h2>
<p>The phrase &#8220;save early, save often&#8221; was a mantra of early computer science. It&#8217;s good advice, but it&#8217;s only half the story. If you&#8217;ve ever sat down for a fast and furious coding session only to realize hours later that you removed something important, you know the frustration of not being able to get it back. It can mean hours lost.</p>
<p>Getting in the habit of regular commits has a number of benefits. First, you can go back to any previously committed version if your coding goes off-track. You can reference earlier parts of your work even if you don&#8217;t need to revert to them. Best of all, it an actually have a positive impact on your code itself.</p>
<h2>Better Code through Committing</h2>
<p>Just as Test-Driven Development influences us to write a larger number of shorter/simpler methods, frequent committing pushes us to think of atomic changes. Atomic in this context means the smallest possible self-sufficient change. Consider this snippet from <em>git log</em>:</p>
<pre name='code' class="ruby">
commit b0e77532b5a8cf236d95f1b3324aabc194568c60
Author: Wally
Date:   Tue Feb 29 23:58:05 2011 -0600

added comments to blog posts
</pre>
<p>This is an example of a commit done at the end of a feature. Lots of code has probably gone into this, and if you wanted to see any of the steps along the way, you&#8217;re out of luck. It&#8217;s also not very easy to see what was changed in the app.</p>
<h2>An Example of Frequent Commits</h2>
<p>Now look at this version:</p>
<pre name='code' class="ruby">
commit e8bba8ad1a4b5c1353c328b505bfa2a9f4816d07
Author: Alice
Date:   Tue Feb 29 14:58:05 2011 -0600

added edit/delete links to each comment if user has permissions

commit 8bba8ad1a4b5c1353c328b505bfa2a9f4816d07e
Author: Alice
Date:   Tue Feb 29 13:58:05 2011 -0600

allowed admins to edit/update/delete any comments

commit bba8ad1a4b5c1353c328b505bfa2a9f4816d07e8
Author: Alice
Date:   Tue Feb 29 11:58:05 2011 -0600

restricted edit/update/delete actions to user's own comments

commit ba8ad1a4b5c1353c328b505bfa2a9f4816d07e8b
Author: Alice
Date:   Tue Feb 29 11:36:20 2011 -0600

created controller/views

commit a8ad1a4b5c1353c328b505bfa2a9f4816d07e8bb
Author: Alice
Date:   Tue Feb 29 10:03:31 2011 -0600

made comments nestable in the model

commit 8ad1a4b5c1353c328b505bfa2a9f4816d07e8bba
Author: Alice
Date:   Tue Feb 29 9:39:24 2011 -0600

defined activerecord associations among users, posts, and comments

commit ad1a4b5c1353c328b505bfa2a9f4816d07e8bba8
Author: Alice
Date:   Tue Feb 29 08:38:01 2011 -0600

added base comment model and migrations
</pre>
<p>You can clearly see the evolution of this feature, and it makes sense. Not only can you step back (if user permissions were implemented incorrectly, for instance) but Alice was &#8220;forced&#8221; to think about each logical step of her development process, instead of jumping in head first. It&#8217;s engineering 101 &#8211; break a problem in its atomic elements, and attack each of those.</p>
<p>Incidentally, this can also help explain to coworkers, bosses, and clients why a seemingly simple task took longer than expected. As you squirm and attempt to justify what you know is an elegant solution, you might not remember all the steps that got you there.</p>
<p>Git remembers.</p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/03/14/git-commit-early-commit-often/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thebes, profiling spork, backup rubygem</title>
		<link>http://databasically.com/2011/03/14/thebes-profiling-spork-backup-rubygem/</link>
		<comments>http://databasically.com/2011/03/14/thebes-profiling-spork-backup-rubygem/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 15:41:34 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=506</guid>
		<description><![CDATA[Thebes, a new minimal sphinx gem for Rails Link Thebes is a wrapper around Sphinx, the search engine we use on most of our projects. Thebes differs from other solutions by staying as far away from your Rails code as possible. Instead of hiding the Sphinx configuration file behind a domain-specific language, this library assumes [...]]]></description>
			<content:encoded><![CDATA[<h1 id="thebes_a_new_minimal_sphinx_gem_for_rails">Thebes, a new minimal sphinx gem for Rails</h1>
<p><a href="www.getharvest.com/blog/2011/03/thebes-a-new-minimal-sphinx-gem-for-rails/" title="Thebes">Link</a></p>
<blockquote>
<p>Thebes is a wrapper around Sphinx, the search engine we use on most of our projects. Thebes differs from other solutions by staying as far away from your Rails code as possible. Instead of hiding the Sphinx configuration file behind a domain-specific language, this library assumes you will write Sphinx config files by hand. In Thebes, you edit an ERB template of your Sphinx configuration and populate it with variables at generation time. For developers needing the most flexible or fastest solution possible, this is a great way to work with Sphinx.</p>
</blockquote>
<p>We&#8217;ve been doing some interesting things with search and reporting that are going to require faster lookups than directly querying the database. From the article &#8220;the [Thinking Sphinx project] has a lot of complexity and ties to ActiveRecord 2.x code. Consequently, the porting of TS to Rails 3 isn’t turning out to be the smooth road we hoped for.  So, for Rails 3 projects, this looks like a good way to go if you&#8217;re willing to get your hands dirty and build some sphinx files yourself.</p>
<h1 id="profiling_spork_for_faster_start_up_time">Profiling Spork for faster start-up time</h1>
<p><a href="http://opinionated-programmer.com/2011/02/profiling-spork-for-faster-start-up-time/" title="Profiling Spork">Link</a></p>
<p>Spork allows you to preload Rails environment files into a process, then it forks that process and runs your tests against the new process.  In essence, your tests will start faster because they&#8217;re not loading everything.  You can specify files you want to be reloaded each time (for instance, model files).</p>
<p>The code:</p>
<p><script src="https://gist.github.com/869238.js"> </script></p>
<p>This prints out everything being loaded up, so you can move files that don&#8217;t change into the preload block for that extra bit of snappiness.</p>
<h1 id="backup_a_rubygem_for_database_and_file_backups">Backup, a rubygem for database and file backups</h1>
<p><a href="https://github.com/meskyanichi/backup" title="Backup rubygem">Link</a></p>
<blockquote>
<p>Backup is a RubyGem (for UNIX-like operating systems: Linux, Mac OSX) that allows you to configure and perform backups in a simple manner using an elegant Ruby DSL. It supports various databases (MySQL, PostgreSQL, MongoDB and Redis), it supports various storage locations (Amazon S3, Rackspace Cloud Files, Dropbox, any remote server through FTP, SFTP, SCP and RSync), it can archive files and folders, it can cycle backups, it can do incremental backups, it can compress backups, it can encrypt backups (OpenSSL or GPG), it can notify you about successful and/or failed backups (Mail or Twitter). It is very extensible and easy to add new functionality to. It&#8217;s easy to use.</p>
</blockquote>
<p>Check out the <a href="https://github.com/meskyanichi/backup/blob/develop/README.md" title="README">README</a> for all the details, but this allows you to backup your app via command line, pushing to S3 or rsync&#8217;ing to another server.  You can schedule it with the fantastic <a href="https://github.com/javan/whenever" title="Whenever gem">Whenever gem</a> too.</p>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/03/14/thebes-profiling-spork-backup-rubygem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A :limit of Rails&#8217; Migrations</title>
		<link>http://databasically.com/2011/03/01/a-limit-of-rails-migrations/</link>
		<comments>http://databasically.com/2011/03/01/a-limit-of-rails-migrations/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 16:35:51 +0000</pubDate>
		<dc:creator>Samuel Mullen</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://databasically.com/?p=472</guid>
		<description><![CDATA[Migrations in Ruby on Rails use the &#8220;:limit&#8221; symbol to set the maximum length of the underlying field&#8217;s data type. Take for example, the following example migration: create_table :things do &#124;t&#124; t.string :name, :limit =&#62; 32 t.string :description t.timestamps end By default, Rails will create :description as data type &#8220;varchar(255)&#8221; and :name as &#8220;varchar(32)&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>Migrations in Ruby on Rails use the &#8220;:limit&#8221; symbol to set the maximum length of the underlying field&#8217;s data type. Take for example, the following example migration:</p>
<pre name='code' class="ruby">create_table :things do |t|
  t.string :name, :limit =&gt; 32
  t.string :description
  t.timestamps
end
</pre>
<p>By default, Rails will create :description as data type &#8220;varchar(255)&#8221; and :name as &#8220;varchar(32)&#8221; in a MySQL database. But did you know you can set :limit to be greater than 255?</p>
<p>For whatever reason, many of us have gained the impression that 255 is the longest :string can be, but that just isn&#8217;t the case. If I wanted the :description field in the example above to be greater than 255, I could just define it as follows:</p>
<pre name='code' class="ruby">t.string :description, :limit =&gt; 1024
</pre>
<p>In fact, strings (i.e. varchars) in MySQL can hold up to 65,535 bytes of data.</p>
<p>The opinionated nature of  Ruby on Rails is a great asset in most instances, but we have to be careful not to let its opinions :limit us.</p>
<p><strong>Note:</strong> I&#8217;m pretty sure Rails sets the default limit of strings to be 255 for two reasons: 1) cross database compatability, and 2) MySQL&#8217;s InnoDB (utf-8) engine can&#8217;t index varchar fields exceeding 255 characters.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.railsinside.com/misc/455-the-perils-of-opinionated-software-like-rails.html">The Perils Of Opinionated Software (like Rails)</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.0/en/data-types.html">MySQL Data Types</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-restrictions.html">Restrictions on InnoDB Tables</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.0/en/char.html">The CHAR and VARCHAR Data Types</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2011/03/01/a-limit-of-rails-migrations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

