I am new to Rails. I have three tables a, b,c
bhas 2 columns:
b1andb2
chas 2 columns: c1andc2
aIt has three columns: a1, b1(foreign key) and the c1(external key)
I want to get pairs distinct (b2, c2)by specifying a value fora1
I tried something like
a.find(:all, :joins => [:b, :c], :select => "b2, c2", :conditions => {:a => {:a1 => Time.now.midnight. ... Time.now}}, :group => "b2, c2")
SQLThat it gives good results, and I can see the results. But I think, as I do a.find, I can not remove b2, c2from the result set.
How can I change this to get b2and c2?
source
share