# How to refactor this

**URL:** <https://www.ruby-forum.com/t/how-to-refactor-this/103178>\
**Category:** Rails\
**Created:** [May 2, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/how-to-refactor-this/103178 "2007-05-02T18:56:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 2, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/how-to-refactor-this/103178/1 "2007-05-02T18:56:51Z")

</div>

Hi,  
I’ve written some model specs, and some code to make them all pass, but  
I  
don’t like the code I’ve written… it’s in desperate need of  
refactoring.  
I’ve included the code, as well as the specs to help you understand what  
I’m  
trying to do. I’d appreciate any help.

[http://pastie.caboo.se/58294](http://pastie.caboo.se/58294)

Thanks,  
-Nathan
