1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-14 08:54:19 +01:00
fab-manager/app/models/machines_pricing.rb

15 lines
283 B
Ruby
Raw Normal View History

2015-05-05 03:10:25 +02:00
class MachinesPricing < ActiveRecord::Base
belongs_to :machine
belongs_to :group
def amount_by_plan(plan)
return not_subscribe_amount if plan.blank?
plan = Plan.find(plan)
if plan.interval == 'month'
month_amount
else
year_amount
end
end
end