0
嗨,我正在为当地的非政府组织进行数据输入系统,该系统对森林中的鸟类进行调查。我有四种模型,分别是Bird,Location,Report和Ratio。虽然鸟&位置只是简单的模型只有一个名称字段,我的报告字段如下。在红宝石模型中计算比率
class Report < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
Date :date
Plumage enum_string(:Breeding, :NonBreeding)
Weather enum_string(:Cloudy, :Sunny, :Humid)
Time enum_string(:Dawn, :Morning, :Noon, :Evening, :Dusk, :Night)
timestamps
end
belongs_to :bird
belongs_to :location
end
而在比率模型中,我需要计算以下逻辑的比率。
鉴于鸟X在的位置大号发现了一个情况下,比 应等于倍鸟X的数量为L的 数量在L.报告总报告的鸟是如何报道我从数据库中取数据 到比率模型?