|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/www/FusionChart/Code/RoR/SampleApp/app/models/fusioncharts/ |
Upload File : |
#Model class to store data of factory id and name.
#As per Ruby On Rails conventions, we have the corresponding table
#french_factory_masters in the database.
class Fusioncharts::FrenchFactoryMaster < ActiveRecord::Base
has_many :factory_output_quantities,
:order => 'date_pro asc',
:foreign_key=>"factory_master_id"
#Calculates the total output quantity by summing the quantity from factory_output_quantities
def total_quantity
self.factory_output_quantities.sum(:quantity)
end
end