# Deploying Rails patches (diff)

**URL:** <https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459>\
**Category:** Rails\
**Created:** [September 2, 2008, 3:04am UTC](https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459 "2008-09-02T03:04:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![c\_dekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Post date:** [September 2, 2008, 3:04am UTC](https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459/1 "2008-09-02T03:04:23Z")

</div>

I am having a problem with a belongs\_to and a has\_one :through relation  
which I found is a known bug in Ruby on Rails:  
[http://rails.lighthouseapp.com/projects/8994/tickets/323-has\_many-through-belongs\_to\_association-bug](http://rails.lighthouseapp.com/projects/8994/tickets/323-has_many-through-belongs_to_association-bug)

This ticket has 6 different attachments. Do I need all of them, or just  
the latest one?  
I can’t seem to find anywhere how one is supposed to deploy these  
patches. Preferably I would patch something in my project that overrides  
the installed rails stack as opposed to patching the installed rails  
stack. How do I do this?

---

<div class="post-metadata">

**Author:** ![c\_dekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Post date:** [September 2, 2008, 9:04am UTC](https://www.ruby-forum.com/t/deploying-rails-patches-diff/147459/2 "2008-09-02T09:04:02Z")

</div>

On Sep 2, 2:04 am, Chris D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I am having a problem with a belongs\_to and a has\_one :through relation  
> which I found is a known bug in Ruby on Rails:[#323 has\_many :through =\> belongs\_to\_association bug - Ruby on Rails - rails](http://rails.lighthouseapp.com/projects/8994/tickets/323-has_many-thr)…
> 
> This ticket has 6 different attachments. Do I need all of them, or just  
> the latest one?  
> I can’t seem to find anywhere how one is supposed to deploy these  
> patches. Preferably I would patch something in my project that overrides  
> the installed rails stack as opposed to patching the installed rails  
> stack. How do I do this?

Well exactly which patch you need to apply would depend on the ticket  
itself. The author could have split his work into several pieces or  
they might be successive versions of the same thing. Read the ticket  
to find out.

You can apply the patch to a copy of rails using git-apply (you’d want  
a copy of rails frozen into your app)

Fred
