Class: Effective::CpdSpecialRule

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/cpd_special_rule.rb

Constant Summary collapse

CATEGORIES =
['cumulative max credits']

Instance Method Summary collapse

Instance Method Details

#cumulative_max_credits?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/models/effective/cpd_special_rule.rb', line 44

def cumulative_max_credits?
  category == 'cumulative max credits'
end

#ruleablesObject

Right now this is going to be just Effective::CpdCategory objects



49
50
51
# File 'app/models/effective/cpd_special_rule.rb', line 49

def ruleables
  cpd_rules.map(&:ruleable)
end

#to_sObject



36
37
38
39
40
41
42
# File 'app/models/effective/cpd_special_rule.rb', line 36

def to_s
  if cumulative_max_credits?
    "Cumulative max #{max_credits_per_cycle} credits"
  else
    model_name.human
  end
end