Class: RailsExecution::Task
- Defined in:
- app/models/rails_execution/task.rb
Constant Summary collapse
- PROCESSING_STATUSES =
%w(created reviewing approved rejected)
Instance Attribute Summary collapse
-
#reviewer_ids ⇒ Object
Returns the value of attribute reviewer_ids.
Instance Method Summary collapse
- #add_files(attachments, current_owner) ⇒ Object
- #assign_reviewers(ids) ⇒ Object
- #in_processing? ⇒ Boolean
Instance Attribute Details
#reviewer_ids ⇒ Object
Returns the value of attribute reviewer_ids.
8 9 10 |
# File 'app/models/rails_execution/task.rb', line 8 def reviewer_ids @reviewer_ids end |
Instance Method Details
#add_files(attachments, current_owner) ⇒ Object
52 53 54 |
# File 'app/models/rails_execution/task.rb', line 52 def add_files(, current_owner) ::RailsExecution.configuration.file_uploader.new(self, , owner: current_owner).call end |
#assign_reviewers(ids) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/models/rails_execution/task.rb', line 36 def assign_reviewers(ids) ids.each do |id| next if id.blank? task_review = self.task_reviews.find_or_initialize_by({ owner_id: id, owner_type: ::RailsExecution.configuration.owner_model.to_s, }) task_review.status ||= :reviewing end end |
#in_processing? ⇒ Boolean
32 33 34 |
# File 'app/models/rails_execution/task.rb', line 32 def in_processing? PROCESSING_STATUSES.include?(self.status) end |