E
Ernst Tanaka
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.findall, :include => {:accounts => {rders =>{}}},
:conditions => ['Orders.flag = 0'],
rder => ['owners.name, accounts.name, orders.id'])
This statement does not work:
owner = Owner.findall,
:include => {:accounts => {:trades =>{}}},
rder => ['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 wner
has_many :trades
has_many rders
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
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.findall, :include => {:accounts => {rders =>{}}},
:conditions => ['Orders.flag = 0'],
rder => ['owners.name, accounts.name, orders.id'])
This statement does not work:
owner = Owner.findall,
:include => {:accounts => {:trades =>{}}},
rder => ['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 wner
has_many :trades
has_many rders
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