我正在使用Rails 3.1.1和PostgreSQL 9.1以及earthdistance module。 爲了能夠正確計算不同位置之間的距離,我在branches表中設置了earth類型的列。 我現在遇到的問題是,使用這個表我的Rails應用程序並不瞭解地球類型,因此我在得到這個我db/schema.rb: # Could not dump table "branches" because o
我知道我可以做 @somethings.each do |something|
/*some work with something*/
end
,但我想知道如果我能遍歷一個@somethings爲 我試圖 for i in 0..10
@somethings[i].myattribute
end
但不會給我我想要的物體或任何物體,據我所知。 我需要使用for循環,我不能做