1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/models/machines_pricing.rb
2015-05-05 03:10:25 +02:00

15 lines
283 B
Ruby

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