Class: Effective::Ballot
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Ballot
- Defined in:
- app/models/effective/ballot.rb
Instance Attribute Summary collapse
-
#current_step ⇒ Object
Returns the value of attribute current_step.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
Instance Method Summary collapse
- #completed? ⇒ Boolean
-
#log_changes? ⇒ Boolean
Disable effective_logging log_changes for this resource.
-
#submit! ⇒ Object
This is the review step where they click Submit Ballot.
- #to_s ⇒ Object
Instance Attribute Details
#current_step ⇒ Object
Returns the value of attribute current_step.
4 5 6 |
# File 'app/models/effective/ballot.rb', line 4 def current_step @current_step end |
#current_user ⇒ Object
Returns the value of attribute current_user.
3 4 5 |
# File 'app/models/effective/ballot.rb', line 3 def current_user @current_user end |
Instance Method Details
#completed? ⇒ Boolean
75 76 77 |
# File 'app/models/effective/ballot.rb', line 75 def completed? completed_at.present? end |
#log_changes? ⇒ Boolean
Disable effective_logging log_changes for this resource
62 63 64 65 |
# File 'app/models/effective/ballot.rb', line 62 def log_changes? return false if poll&.skip_logging? true end |
#submit! ⇒ Object
This is the review step where they click Submit Ballot
68 69 70 71 72 73 |
# File 'app/models/effective/ballot.rb', line 68 def submit! wizard_steps[:complete] ||= Time.zone.now self.completed_at ||= Time.zone.now save! end |
#to_s ⇒ Object
57 58 59 |
# File 'app/models/effective/ballot.rb', line 57 def to_s model_name.human end |