<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>class DirtyInformation - Home</title>
  <id>tag:www.dirtyinformation.com,2010:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://www.dirtyinformation.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.dirtyinformation.com/" rel="alternate" type="text/html"/>
  <updated>2009-11-25T01:45:20Z</updated>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-11-25:68</id>
    <published>2009-11-25T01:17:00Z</published>
    <updated>2009-11-25T01:45:20Z</updated>
    <category term="kata"/>
    <link href="http://www.dirtyinformation.com/2009/11/25/how-many-checkouts-code-kata" rel="alternate" type="text/html"/>
    <title>How Many Checkouts - Code Kata</title>
<content type="html">
            &lt;p&gt;
I've been thinking a lot lately about code katas and I wanted to come up with one on my own.  Now I need to get it out there to find out what others think, and force my self to actually do it.
&lt;/p&gt;
&lt;p&gt;
Simulate a checkout line at a retail store in order to find the best solution for keeping customers happy but minimizing checkout lanes.
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Specs&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;
    Customers get in the shortest line every 40 seconds
  &lt;/li&gt;
  &lt;li&gt;
    Customers of this store always buy 10 items.
  &lt;/li&gt;
  &lt;li&gt;
    Each item takes 5 seconds to scan and bag
  &lt;/li&gt;
  &lt;li&gt;
    Each customer takes another 20 seconds to pay and then they checker can start on the next customer
  &lt;/li&gt;
  &lt;li&gt;
    Customers become unhappy if they have to wait more than 30 seconds before starting to checkout
  &lt;/li&gt;
  &lt;li&gt;
    Customers leave after 50 seconds of waiting to checking out
  &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;
    How many lanes do I need to keep 80% of my customers happy?
  &lt;/li&gt;
  &lt;li&gt;
    How many lanes do I need to keep all customers happy?
  &lt;/li&gt;
  &lt;li&gt;
    How many lanes do I need to make sure no customers leave?
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
  I know that this isn't really scientific, but I thought it might be fun.  I also know that each run may come up with different results, but if I run it a lot I think I can come up with a good average.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-11-05:62</id>
    <published>2009-11-05T02:18:00Z</published>
    <updated>2009-11-05T02:45:03Z</updated>
    <category term="agile"/>
    <link href="http://www.dirtyinformation.com/2009/11/5/agile-says-what" rel="alternate" type="text/html"/>
    <title>Agile Says What?</title>
<content type="html">
            &lt;p&gt;
The other night I spend forty-five minutes on the phone with a friend talking about what agile is.  He hadn't been exposed to the ideas behind agile.  When I started talking I don't think I really hit on what agile IS.  I talked about practices and the way my team works.  He had many of those methods in his experiences but not all of them, and not really in what I would consider agile.  After I got off the phone I noticed that I only talked about practices and not about principles.  So I thought to myself, &quot;What IS agile?&quot;
&lt;/p&gt;
&lt;p&gt;
This is a hard question for me to answer.  Every time I start to think about it I go back to the practices that I use in order to achieve what I consider agile.  That isn't right.  Agile isn't a set of practices, is it?  No it can't be.  The &lt;a href=&quot;http://agilemanifesto.org/&quot;&gt;Agile Manifesto&lt;/a&gt; specifically states &quot;Individuals and interactions over processes and tools.&quot;  If it isn't about processes what is it?
&lt;/p&gt;
&lt;p&gt;
The more I thought the more agile seemed to be nothing more than agility.  Every methodology that I talked about had to do with the ability to change direction at the drop of a hat.  Agile is about reaction.  Not just any reaction, but ones that cause positive change and outcomes.  Agile is about feedback and learning.  After all this...Am I agile?
&lt;/p&gt;
&lt;p&gt;
I am agile.  I am constantly learning from every source at my disposal.  I go looking for ways to improve myself and my product.  I adapt to change.  I am always trying to push the envelope further.  Yet, I can't help but feel that I missing something?  What am I missing?
&lt;/p&gt;
&lt;p&gt;
The one thing that I didn't mention above.  Is it in there somewhere?  Delivering a useable project at any point in development.  That is it.  That is what I'm missing.  This has got to be the hardest part of agile.  No matter what we do it always seems that we are one step away from delivering that product at the drop of a hat.  If the customer says, &quot;I want to deploy now.&quot;  I should be able to happily say, &quot;Already done.&quot;  Not that I don't have software that I can deploy all the time, but what really makes a project &quot;useable?&quot;  Can I deliver something that can be let out into the world every week?
&lt;/p&gt;
&lt;p&gt;
That is my goal.  From this moment forward I'm going to try and guide my project and my customer so that we are always moving forward with usable software.  Not a half done feature at the end of an iteration.  I'm going to try and guide the story selection for my projects so that at the end of each iteration we have something to &quot;useable&quot; to deliver.  Is it possible?
&lt;/p&gt;
&lt;p&gt;
What is useable?  Is this really possible, or is it an ideal that we strive to achieve knowing that it doesn't quite work that way.  Once we have the app in production it is easy to keep that way, but is continuous deployment really possible from day zero?  Can each commit still be tiny yet completely deployable?  What are your thoughts?  Also did I miss anything that defines agile, but isn't a practice/methodology?
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-11-03:59</id>
    <published>2009-11-03T03:19:00Z</published>
    <updated>2009-11-03T03:34:54Z</updated>
    <category term="articles"/>
    <category term="code review"/>
    <category term="open source"/>
    <category term="team"/>
    <link href="http://www.dirtyinformation.com/2009/11/3/your-code-review" rel="alternate" type="text/html"/>
    <title>Your Code Review</title>
<content type="html">
            &lt;p&gt;
Code reviews are often abused and executed in ways that drive developers mad, but when executed correctly they strength relationships and skill sets.
&lt;/p&gt;
&lt;p&gt;
Have you ever had your code reviewed and walked away feeling upset or pissed?  What was so bad about it?  Is there better way that the reviewer could have expressed their feelings?
&lt;/p&gt;
&lt;p&gt;
Have you ever had a great review?  Did you walk away feeling smarter and more excited about the project?  What did the reviewer do that was so much better than what you have seen from others?
&lt;/p&gt;
&lt;p&gt;
Do you do code reviews?  Do you have a checklist that you follow when completing reviews?  What things should you watch for when looking through code?  Are there any good ways to find the trouble spots in code?
&lt;/p&gt;
&lt;p&gt;
I know I haven't given much except a list of questions, but I'm working on an article and I had to get these out there to help my brain start going.  I'd love to hear what anyone has to say on the subject.  Thanks.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-07-09:57</id>
    <published>2009-07-09T04:02:00Z</published>
    <updated>2009-07-09T04:07:04Z</updated>
    <category term="authlogic"/>
    <category term="edge"/>
    <category term="rails"/>
    <category term="Rails"/>
    <link href="http://www.dirtyinformation.com/2009/7/9/authlogic-and-rails-3-0pre" rel="alternate" type="text/html"/>
    <title>Authlogic and Rails 3.0pre</title>
<content type="html">
            &lt;p&gt;
  With some of the moving around of code in Rails 3 Authlogic is broken.  This is a quick fix, and not the solution.  Add the following to your Session class:
&lt;/p&gt;

&lt;pre&gt;
class UserSession &amp;lt; Authlogic::Session::Base
  def self.model_name
    ActiveModel::Name.new(self.to_s)
  end
end
&lt;/pre&gt;

&lt;p&gt;
You should be good to go.  I have to read up on the process for patching authlogic.  Right now it is late and I am sick.  I hope this quick fix gets someone going.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-04-22:54</id>
    <published>2009-04-22T17:00:00Z</published>
    <updated>2009-04-22T17:03:30Z</updated>
    <category term="OSS"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <link href="http://www.dirtyinformation.com/2009/4/22/truly-open-source" rel="alternate" type="text/html"/>
    <title>Truly Open Source</title>
<content type="html">
            &lt;p&gt;
I want to have a project that is truly open source.  So I thought I would try an experiment.  I asked &lt;a href=&quot;http://github.com/defunkt&quot;&gt;defunkt&lt;/a&gt; to completely open &lt;a href=&quot;http://github.com/adkron/legacy_woes&quot;&gt;legacy_woes&lt;/a&gt; up to everyone with a &lt;a href=&quot;http://github.com&quot;&gt;github&lt;/a&gt; account.  So feel free to commit whatever you want, but try to keep it in the scope of the gem/plugin.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-27:51</id>
    <published>2009-02-27T03:41:00Z</published>
    <updated>2009-02-27T15:28:22Z</updated>
    <category term="code review"/>
    <link href="http://www.dirtyinformation.com/2009/2/27/code-review-continued" rel="alternate" type="text/html"/>
    <title>Code Review Continued</title>
<content type="html">
            &lt;p&gt;
I just sent my coworker and email tried out some of the ideas out of my post from two days ago.  I sent it to him with a little blurb at the top saying that I'm trying out a new method of code review, and I would love his feedback on it.  I would also like some feedback from all of you.  Should I word parts differently?  Should I scrap the whole idea, and start over?  Where can I improve?  Do you have any techniques that you find useful?
&lt;/p&gt;

&lt;p&gt;
The files and names have been changed to protect the innocent.
&lt;/p&gt;



&lt;pre&gt;
FooController

Lines 235, 236, 237 is there a reason why we are raising exceptions here?
When finding by id why did you choose ActiveRecord::Base#find and not ActiveRecord::Base#first?
Is there a reason for choosing a polymorphic relationship and not Single Table Inheritance(STI)?
How could add_comment(265 to 282) differ if you used STI?
Is it possible to utilize both polymorphic and STI, are there any advantages to doing that?

CommentNotificationTemplate

Line 13 - Any reason why this isn't using some kind of url helper method?
Line 13 - Do we need this line at all if there is a helper method to be used in the template?
Lines 28 - 30: Why is this static method even around?

html.erb
Line 12 - Can we use a helper for this?  Or make a route?

text.erb
Line 8 - Same questions about the url that is assigned in the controller.

In the tests there is a factory being used, but everything the factory includes is overridden.  Is there a reason?

The story template test could really benefit from a url helper.

Francis, this is great work.  I love to see that you got rid of the comment fixture.  I think this is a big step in the direction we need to go.  Your code is getting better all the time.  Keep up the good work.
&lt;/pre&gt;



&lt;p&gt;
The follow question was used to provoke thought from the reviewed &quot;is it possible to utilize both polymorphic and STI, are there any advantages to doing that?&quot;  I just want him to think with that one.  Is this a workable tactic?  I would love to help him continue his amazing growth.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-26:50</id>
    <published>2009-02-26T05:10:00Z</published>
    <updated>2009-02-26T05:24:04Z</updated>
    <category term="integration"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="testing"/>
    <link href="http://www.dirtyinformation.com/2009/2/26/organizing-integration-tests" rel="alternate" type="text/html"/>
    <title>Organizing Integration Tests</title>
<content type="html">
            &lt;p&gt;
I've been in meetings all day so I don't have a lot to write about, but I have to keep up with my blog post a day.  So without further ado we need to organize our integration tests.
&lt;/p&gt;
&lt;p&gt;
We've been trying to find out how to better organize our integration testing for a while.  We started out by having each test file organized by the controller involved.  This works fine for small controllers that aren't interacting with other controllers.
&lt;/p&gt;
&lt;p&gt;
My next idea was to organize them by controller method.  That helped slim down a lot of the test files, and put them in a more readable format.  This was a great step but when pages have a lot of functionality this too can become a burden, and make test file become lng and unruly.
&lt;/p&gt;
&lt;p&gt;
Tonight I began work on converting one such test file into functional sections.  We have a page in the project that has a lot of information, forms, links, et al.  I decided that the integration tests for this page should be broken up by functional areas.  Anything outside of a functional area will go into a test file for the overall page.  The overall test file will contain things like breadcrumb link tests, and tests for user access.
&lt;/p&gt;
&lt;p&gt;
Right now we are using &lt;a href=&quot;http://thoughtbot.com/projects/shoulda/&quot;&gt;shoulda&lt;/a&gt; and &lt;a href=&quot;http://github.com/brynary/webrat&quot;&gt;webrat&lt;/a&gt; for our integration testing.  I'm hoping that soon we will have &lt;a href=&quot;http://github.com/aslakhellesoy/cucumber/tree/master&quot;&gt;cucumber&lt;/a&gt; in the mix.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-25:47</id>
    <published>2009-02-25T04:37:00Z</published>
    <updated>2009-02-25T05:13:28Z</updated>
    <category term="refactor"/>
    <category term="review"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <category term="tools"/>
    <link href="http://www.dirtyinformation.com/2009/2/25/code-review-toolbox" rel="alternate" type="text/html"/>
    <title>Code Review Toolbox</title>
<content type="html">
            &lt;p&gt;
Doing a code review is difficult for me.  I don't always think of the design implications because I'm trying t hurry and get back to coding.  I have mainly been checking for tests, and functionality.  This needs to change and I think I've got some decent steps to help me make the leap, and use some tools to help illustrate my concerns to my coworkers.
&lt;/p&gt;


  &lt;dt&gt;&lt;a href=&quot;http://jonathanaquino.com/CodeReviews.pdf&quot;&gt;Code Review Cheat Sheet&lt;/a&gt;&lt;/dt&gt;
  &lt;dd&gt;Great points on how to handle a code review without upsetting the developer of that code.&lt;/dd&gt;

 &lt;dt&gt;&lt;a href=&quot;http://ruby.sadi.st/Flog.html&quot;&gt;Flog&lt;/a&gt;&lt;/dt&gt;
  &lt;dd&gt;A 'golf' score for your code.  Anytime code hurts my eyes, flog has a score that backs up my thoughts.  Even without the developer knowing how things are being scored numbers seem to work for us.&lt;/dd&gt;

  &lt;dt&gt;&lt;a href=&quot;http://ruby.sadi.st/Flay.html&quot;&gt;Flay&lt;/a&gt;&lt;/dt&gt;
  &lt;dd&gt;Find violations of the dry principle and often fixing these issues can lower your flog score.&lt;/dd&gt;

  &lt;dt&gt;&lt;a href=&quot;http://github.com/martinjandrews/roodi/tree/master&quot;&gt;Roodi&lt;/a&gt;&lt;dt&gt;
  &lt;dd&gt;Points out OO Design principle issues.  I haven't used this much, but the few test runs I tried came up with some good suggestions.  Really you should just check out the docs for all the things Roodi does.&lt;/dd&gt;

  &lt;dt&gt;&lt;a href=&quot;http://github.com/kevinrutherford/reek/tree/master&quot;&gt;Reek&lt;/a&gt;&lt;dt&gt;
  &lt;dd&gt;Ruby code smell detector.  Reek looks for a lot of common &lt;a href=&quot;http://wiki.github.com/kevinrutherford/reek/code-smells&quot;&gt;code smells&lt;/a&gt; and is easily configureable.&lt;/dd&gt;
&lt;/ul&gt;

&lt;p&gt;
I hope that by bringing a new approach to code reviews I can improve our product, team morale, and the skills of everyone involved.  I will keep you posted on how my toolbox works out.  I'd also welcome any suggestions on source about improving code reviews and/or tools like the above that help focus where I need to spend the most time reviewing.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-24:44</id>
    <published>2009-02-24T04:59:00Z</published>
    <updated>2009-02-24T05:36:47Z</updated>
    <category term="design principles"/>
    <category term="inheritance"/>
    <category term="refactor"/>
    <link href="http://www.dirtyinformation.com/2009/2/24/inheritance-i-am-done-with-you" rel="alternate" type="text/html"/>
    <title>Inheritance, I am Done With You</title>
<content type="html">
            &lt;p&gt;
I'm so tired of running into issues with inheritance.  I avoid it like the plague, but unfortunately I have to deal with it in some of the code I work with.  Tonight is the night that I lower my tolerance level for inheritance.
&lt;/p&gt;
&lt;p&gt;
I used to think deep inheritance was the only issue.  Tonight I was trying to refactor a controller class, but every time I changed something  a bunch of other controllers would break.  I can handle this for a little while, but this is really starting to get annoying.  One level of inheritance still causing pain.  The final straw was when I tried to add a before filter to the to controller and all my show methods in the other controllers quit working. 
&lt;/p&gt;
&lt;p&gt;
Now I'm off to convince the rest of the team to lower their tolerance levels.  We all knows it's bad, but we need to stop drinking a case a day.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-23:43</id>
    <published>2009-02-23T04:04:00Z</published>
    <updated>2009-02-23T04:10:02Z</updated>
    <category term="self improvement"/>
    <link href="http://www.dirtyinformation.com/2009/2/23/getting-better-at-writing" rel="alternate" type="text/html"/>
    <title>Getting Better at Writing</title>
<content type="html">
            &lt;p&gt;
I'd really like to get better at writing, and get more of the thoughts out that are always clogging up my brain.  My wife is an English teacher and I could have her proof everything, but I don't want to bother her with that.  Since practice makes perfect, I'm going to try to write something every day!  I'm just warning anyone who might actually read this stuff, you might see a lot of gibberish posts when I'm just trying to force something out.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-02-23:42</id>
    <published>2009-02-23T03:40:00Z</published>
    <updated>2009-02-23T04:04:13Z</updated>
    <category term="REST"/>
    <link href="http://www.dirtyinformation.com/2009/2/23/sup" rel="alternate" type="text/html"/>
    <title>SUP</title>
<content type="html">
            &lt;p&gt;Stop URL Parameters(SUP)&lt;/p&gt;
&lt;p&gt;
Any time I see a ?foo=bar in a url I get so frustrated.  I'm especially irritated when it the parameters came from a form.  Let's stop this horrible practice.  If you need parameters great, but pass them with a post or as part of the regular url.
&lt;/p&gt;
&lt;p&gt;
I've seen this happening at an increasing rate.  It usually comes with someone trying to follow RESTful principles with their code, but becoming confused along the way.  Here is an example:
&lt;p&gt;
&lt;ul&gt;
  &lt;li&gt;I have a few reports that I want to display based on some dates&lt;/li&gt;
  &lt;li&gt;...I know...that is a &quot;show&quot; method since I'm &quot;showing&quot; data to the user&lt;/li&gt;
  &lt;li&gt;Now I need the report to be based on a date range.&lt;/li&gt;
  &lt;li&gt;I also need a select box for the report type to be chosen.&lt;/li&gt;
  &lt;li&gt;I'll make a form that posts to this action here, and then it will redirect to the correct report.&lt;/li&gt;
  &lt;li&gt;hmm...How am I going to pass those dates along...Eureka! I'll just put  ?start_date=foo&amp;end_date=bar on my URL&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Now is the time to say STOP!  Why do you want to do this.  Sit back, and rethink your actions.  Starting down the path of just tossing the parameters into the url can lead to many problems.  It is like a gateway drug.  It seems so easy and useful the first time, and now you've got secure data in the url, and a horrible API, and we won't even talk about error handling and the back-end code that is making this up.  Now that your boss is angry that you passed an SSN in the url you would like to go back and fix this issue once and for all.
&lt;/p&gt;
&lt;p&gt;
It is OK to display data with a create or update.  If you have a mental block on this think of it as creating the report.  Then instead of having a new controller for each report, and a show action for each have the create action render a specific template based on the report selected.  The partial can even be the name of the report, then you don't need an if/case block.  Now you've got one small method that is handling all the reports.  If they are complicated create some models for the reports, and your set.
&lt;/p&gt;
&lt;p&gt;
I've been wanting to get that off my chest.
&lt;p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2009-01-15:39</id>
    <published>2009-01-15T00:18:00Z</published>
    <updated>2009-01-15T00:39:47Z</updated>
    <category term="articles"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <category term="testing"/>
    <link href="http://www.dirtyinformation.com/2009/1/15/let-me-test-your-rails-ruby-app" rel="alternate" type="text/html"/>
    <title>Let Me Test Your Rails/Ruby App</title>
<content type="html">
            &lt;p&gt;
I'm going to be doing some writing for a few magazines and I would like to write tests for you.  If you have a part of your app that is particularly hard to test and you would like some help, send me the whole app or just the parts that are pertinent.
&lt;/p&gt;
&lt;p&gt;
I know what you might be thinking, &quot;Who does this guy think he is?&quot;  I'm a full time Rails developer on an application that must support Oracle and MySql.  I also must interact with a Java side and a ten year old database. Here is the read out from 'rake stats' and 'time rake test.'
&lt;/p&gt;
&lt;pre&gt;
Unit tests: 1965 tests, 4358 assertions, 0 failures, 0 errors
Functional tests: 705 tests, 2567 assertions, 0 failures, 0 errors
Integration tests: 202 tests, 303 assertions, 0 failures, 0 errors
real	2m58.057s
user	2m13.305s
sys	0m12.093s

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  4361 |  3711 |      69 |     379 |   5 |     7 |
| Helpers              |  1025 |   852 |       0 |     127 |   0 |     4 |
| Models               |  4301 |  3490 |      87 |     460 |   5 |     5 |
| Libraries            |  7294 |  5192 |      78 |     483 |   6 |     8 |
| Integration tests    |  2004 |  1741 |      24 |      20 |   0 |    85 |
| Functional tests     |  7855 |  5878 |      97 |     564 |   5 |     8 |
| Unit tests           |  9356 |  7283 |     108 |     673 |   6 |     8 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 36196 | 28147 |     463 |    2706 |   5 |     8 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 13245     Test LOC: 14902     Code to Test Ratio: 1:1.1

&lt;/pre&gt;
&lt;p&gt;
You can hit me up on &lt;a href=&quot;http://twitter.com/adkron&quot;&gt;Twitter&lt;/a&gt; or email at gmail to amos.l.king.
&lt;p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2008-12-20:36</id>
    <published>2008-12-20T03:57:00Z</published>
    <updated>2008-12-20T14:11:03Z</updated>
    <category term="active record"/>
    <category term="gem"/>
    <category term="legacy"/>
    <category term="rails"/>
    <category term="Rails"/>
    <link href="http://www.dirtyinformation.com/2008/12/20/legacy-woes" rel="alternate" type="text/html"/>
    <title>Legacy Woes</title>
<content type="html">
            &lt;p&gt;
I've been working with a legacy database for a while, and I'm getting tired of writing methods to do all of the nice hooks that ActiveRecord comes with.  Hooks like automatically setting  created_at on a save.  I did what any self respecting lazy programmer would do, and created a new gem, &lt;a href=&quot;http://github.com/adkron/legacy_woes&quot;&gt;LegacyWoes&lt;/a&gt;.  If you fix some legacy issues I'd love to talk or take a patch.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2008-12-10:35</id>
    <published>2008-12-10T16:04:00Z</published>
    <updated>2008-12-10T16:15:15Z</updated>
    <category term="legacy"/>
    <category term="monkey patch"/>
    <category term="polymorphic"/>
    <category term="rails"/>
    <category term="Rails"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <link href="http://www.dirtyinformation.com/2008/12/10/legacy-polymorphic-associations" rel="alternate" type="text/html"/>
    <title>Legacy Polymorphic Associations</title>
<content type="html">
            &lt;p&gt;
Did I mention I hate legacy databases.
&lt;/p&gt;
&lt;p&gt;
I'm working on a legacy project that uses a polymophic associations where the type column is lower case.  The thing that sucks is I can't change the database because I still have an untested  Java side that we don't want to change.  So here comes the solution, and maybe some flames.
&lt;/p&gt;
&lt;p&gt;
ActiveRecord::AttributeMethods#read_attribute is called on the type field, which we will call foo, because it isn't called type in our database.  So in our model we have this:
&lt;/p&gt;
&lt;pre&gt;
#Disclaimer
def read_attribute(attr_name)
  if attr_name == 'foo'
    #code to change to accepted type column values
    foo.camelize
  else
    super
  end
end
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://www.dirtyinformation.com/">
    <author>
      <name>Amos</name>
    </author>
    <id>tag:www.dirtyinformation.com,2008-11-26:32</id>
    <published>2008-11-26T02:37:00Z</published>
    <updated>2008-11-28T03:09:58Z</updated>
    <category term="data_bank"/>
    <category term="gem"/>
    <category term="ruby"/>
    <category term="Ruby"/>
    <link href="http://www.dirtyinformation.com/2008/11/26/data-bank-gem" rel="alternate" type="text/html"/>
    <title>Data Bank Gem</title>
<content type="html">
            &lt;p&gt;
I completed my first gem.  I've worked on gems before, but this one is entirely mine.
&lt;/p&gt;
&lt;p&gt;
It is a small gem for data marshaling.  I hope someone finds it useful.
It can be found at &lt;a href=&quot;http://github.com/Adkron/data_bank/tree/master&quot;&gt;Github&lt;/a&gt;
&lt;/p&gt;
          </content>  </entry>
</feed>
