Class: Effective::CpdStatementActivity
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::CpdStatementActivity
- Defined in:
- app/models/effective/cpd_statement_activity.rb
Instance Attribute Summary collapse
-
#importing ⇒ Object
Returns the value of attribute importing.
-
#max_score ⇒ Object
Returns the value of attribute max_score.
Instance Method Summary collapse
- #destroy ⇒ Object
- #is_carry_over? ⇒ Boolean
-
#locked? ⇒ Boolean
Will display as read-only on form.
- #original_cycle ⇒ Object
- #reduced_messages ⇒ Object
- #to_debug ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#importing ⇒ Object
Returns the value of attribute importing.
4 5 6 |
# File 'app/models/effective/cpd_statement_activity.rb', line 4 def importing @importing end |
#max_score ⇒ Object
Returns the value of attribute max_score.
3 4 5 |
# File 'app/models/effective/cpd_statement_activity.rb', line 3 def max_score @max_score end |
Instance Method Details
#destroy ⇒ Object
60 61 62 63 64 |
# File 'app/models/effective/cpd_statement_activity.rb', line 60 def destroy return false if cpd_statement.completed? return false unless cpd_statement.cpd_cycle.available? super end |
#is_carry_over? ⇒ Boolean
74 75 76 |
# File 'app/models/effective/cpd_statement_activity.rb', line 74 def is_carry_over? original.present? end |
#locked? ⇒ Boolean
Will display as read-only on form
83 84 85 |
# File 'app/models/effective/cpd_statement_activity.rb', line 83 def locked? is_carry_over? || cpd_statement&.completed? end |
#original_cycle ⇒ Object
78 79 80 |
# File 'app/models/effective/cpd_statement_activity.rb', line 78 def original_cycle (original || self).cpd_statement.cpd_cycle end |
#reduced_messages ⇒ Object
70 71 72 |
# File 'app/models/effective/cpd_statement_activity.rb', line 70 def self[:reduced_messages] ||= {} end |
#to_debug ⇒ Object
87 88 89 |
# File 'app/models/effective/cpd_statement_activity.rb', line 87 def to_debug "id=#{id}, score=#{score}, carry_foward=#{carry_forward}, carry_from_last=#{carry_over}, original=#{original&.id}" end |
#to_s ⇒ Object
66 67 68 |
# File 'app/models/effective/cpd_statement_activity.rb', line 66 def to_s (cpd_activity || 'activity').to_s end |