# Activerecord new version differences

**URL:** <https://www.ruby-forum.com/t/activerecord-new-version-differences/140099>\
**Category:** Ruby\
**Created:** [June 10, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099 "2008-06-10T20:49:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ernsttanaka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/46a35a/32.png) [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Post date:** [June 10, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099/1 "2008-06-10T20:49:09Z")

</div>

I am sorry, but I am struggling. I installed new versions of my gems and  
my programs don’t run anymore. As suggested I tried to roll back to  
older versions, but that is becoming a bigger mess. The flight forward  
has at least recovered 90% of my application.

Both statement worked perfect with the old version of activerecord.  
Now the first one works okay, the last one does not get the join built  
up in the sql statement.

Again thanks for all the help.  
Ernst

This statement works:

owner = Owner.find(:all, :include =\> {:accounts =\> {:orders =\>{}}},  
:conditions =\> [‘Orders.flag = 0’],  
:order =\> [‘owners.name, accounts.name, orders.id’])

This statement does not work:  
owner = Owner.find(:all,  
:include =\> {:accounts =\> {:trades =\>{}}},  
:order =\> [‘owners.name, accounts.name, trades.underlying, trades.month,  
trades.strategy’] )

* * *

The error I get is a that accounts.name is not a valid column. Which is  
caused by the fact that the join is not added into the SQL statement.

Here is my Schema:  
class Owner \< ActiveRecord::Base  
has\_many :accounts  
end  
class Account \< ActiveRecord::Base  
belongs\_to :owner  
has\_many :trades  
has\_many :orders  
end  
class Order \< ActiveRecord::Base  
belongs\_to :account  
end  
class Trade \< ActiveRecord::Base  
belongs\_to :account  
has\_many :legs  
end  
class Leg \< ActiveRecord::Base  
belongs\_to :trade  
end  
class Earning \< ActiveRecord::Base  
end

---

<div class="post-metadata">

**Author:** ![ernsttanaka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/46a35a/32.png) [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Post date:** [June 10, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099/2 "2008-06-10T20:59:13Z")

</div>

On Jun 10, 2008, at 11:48 , Ernst T. wrote:

> I am sorry, but I am struggling. I installed new versions of my gems  
> and  
> my programs don’t run anymore. As suggested I tried to roll back to  
> older versions, but that is becoming a bigger mess. The flight forward  
> has at least recovered 90% of my application.

this really isn’t the place for rubyonrails questions… join the  
rubyonrails mailing list and ask there, or ask in irc on #rubyonrails  
on [irc.freenode.net](http://irc.freenode.net).

The mailing list is probably more helpful (signal:noise), I dunno, but  
irc is more immediate.

---

<div class="post-metadata">

**Author:** ![ernsttanaka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/46a35a/32.png) [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Post date:** [June 10, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099/3 "2008-06-10T21:04:22Z")

</div>

Ryan; I might be misguided but I am not using rails in this application.  
Just trying to access a database while using Activerecord. There are  
probably 100 smarter ways to do it. But as a nuby I am happy with the  
one I found that worked for my over the last 6 months.

Thks,

Ernst

---

<div class="post-metadata">

**Author:** ![ernsttanaka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/46a35a/32.png) [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Post date:** [June 10, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099/4 "2008-06-10T23:10:50Z")

</div>

On Jun 10, 2008, at 12:04 , Ernst T. wrote:

> Ryan; I might be misguided but I am not using rails in this  
> application.  
> Just trying to access a database while using Activerecord. There are  
> probably 100 smarter ways to do it. But as a nuby I am happy with the  
> one I found that worked for my over the last 6 months.

Active record is developed and maintained by the rails developers.  
They provide the support for it.

---

<div class="post-metadata">

**Author:** ![ernsttanaka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/46a35a/32.png) [@ernsttanaka](https://www.ruby-forum.com/u/ernsttanaka)\
**Post date:** [June 10, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/activerecord-new-version-differences/140099/5 "2008-06-10T23:31:43Z")

</div>

thanks; I re-posted on the rails section of this forum.
