B.where(a_id: @As)
if you have a massive amounts of Bs the Data Base server will hate you,so a
better solution is
@Bs=Array.new
@As.each do |a|
@Bsa.bs
end
El jueves, 10 de abril de 2014 23:20:53 UTC+2, Ruby-Forum.com User escribió:
I have class A and B. A has many Bs.
B has a field
Ups i forget the visible condition
B.where(a_id: @As, is_visible: true)
if you have a massive amounts of Bs the Data Base server will hate
you,so a better solution is
@Bs=Array.new
@As.each do |a|
@BsB.where(a_id: a, is_visible: true)
end
--
Posted via http://www.ruby-forum.com/.
--
You
Ups i forget the visible condition
B.where(a_id: @As, is_visible: true)
if you have a massive amounts of Bs the Data Base server will hate you,so a
better solution is
@Bs=Array.new
@As.each do |a|
@Bsa.bs.select{ |b| b.is_visible}
end
El jueves, 10 de abril de 2014 23:20:53 UTC+2,
On Friday, 11 April 2014 07:13:25 UTC-4, Ruby-Forum.com User wrote:
Ups i forget the visible condition
B.where(a_id: @As, is_visible: true)
if you have a massive amounts of Bs the Data Base server will hate
you,so a better solution is
@Bs=Array.new
@As.each do |a|
4 matches
Mail list logo