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
- #is_carry_over? ⇒ Boolean
-
#locked? ⇒ Boolean
Will display as read-only on form.
- #original_cycle ⇒ Object
- #reduced_messages ⇒ Object
-
#reportable_scopes ⇒ Object
effective_reports.
- #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
#is_carry_over? ⇒ Boolean
73 74 75 |
# File 'app/models/effective/cpd_statement_activity.rb', line 73 def is_carry_over? original.present? end |
#locked? ⇒ Boolean
Will display as read-only on form
82 83 84 |
# File 'app/models/effective/cpd_statement_activity.rb', line 82 def locked? is_carry_over? || cpd_statement&.completed? end |
#original_cycle ⇒ Object
77 78 79 |
# File 'app/models/effective/cpd_statement_activity.rb', line 77 def original_cycle (original || self).cpd_statement.cpd_cycle end |
#reduced_messages ⇒ Object
69 70 71 |
# File 'app/models/effective/cpd_statement_activity.rb', line 69 def self[:reduced_messages] ||= {} end |
#reportable_scopes ⇒ Object
effective_reports
48 49 50 |
# File 'app/models/effective/cpd_statement_activity.rb', line 48 def reportable_scopes { draft: nil, completed: nil } end |
#to_debug ⇒ Object
86 87 88 |
# File 'app/models/effective/cpd_statement_activity.rb', line 86 def to_debug "id=#{id}, score=#{score}, carry_foward=#{carry_forward}, carry_from_last=#{carry_over}, original=#{original&.id}" end |
#to_s ⇒ Object
65 66 67 |
# File 'app/models/effective/cpd_statement_activity.rb', line 65 def to_s cpd_activity.to_s.presence || model_name.human end |