Banging by head against a wall here, and i'm sure this is easy
I have a table called channel_statistics and one called installations
in both there is a column called node_identifier
I want to be able to do
ChannelStatistic.find(:all, :include => [:installations]) as this has
a lot of data in it I want to eager load
so i have tried
class ChannelStatistic < ActiveRecord::Base
belongs_to :installation, :foreign_key => 'node_identifier'
class Installation < ActiveRecord::Base
has_many :channel_statistics, :foreign_key => 'node_identifier'
but to no avail.
It always performs the "LEFT OUTER JOIN on installations.id =
What I want it to do is "LEFT OUTER JOIN on
installations.node_identifier = channel_statistics.node_identifier"
Guess they might not be able to handle this but it seems unlikely
Possibility that with_scope might help but I have never got that
working how I want either