mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-14 08:54:19 +01:00
15 lines
283 B
Ruby
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
|