Bug #302 ยป 0001-Change-to_label-to-to_s-in-count_habtm.patch
app/models/host.rb | ||
---|---|---|
output = {}
|
||
Host.count(:include => assocication.pluralize, :group => "#{assocication}_id").to_a.each do |a|
|
||
#Ugly Ugly Ugly - I guess I'm missing something basic here
|
||
label = eval(assocication.camelize).send("find",a[0].to_i).to_label if a[0]
|
||
label = eval(assocication.camelize).send("find",a[0].to_i).to_s if a[0]
|
||
output[label] = a[1]
|
||
end
|
||
output
|