Class: Tasker::StepDagRelationship
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Tasker::StepDagRelationship
- Defined in:
- app/models/tasker/step_dag_relationship.rb
Instance Method Summary collapse
- #child_step_ids_array ⇒ Object
- #has_children? ⇒ Boolean
- #has_parents? ⇒ Boolean
- #leaf_step? ⇒ Boolean
-
#parent_step_ids_array ⇒ Object
Parse JSONB arrays for relationship access.
-
#readonly? ⇒ Boolean
Read-only model backed by database view.
-
#root_step? ⇒ Boolean
Helper methods for DAG navigation.
Methods inherited from ApplicationRecord
configure_database_connections, database_configuration_exists?
Instance Method Details
#child_step_ids_array ⇒ Object
59 60 61 62 63 |
# File 'app/models/tasker/step_dag_relationship.rb', line 59 def child_step_ids_array return [] if child_step_ids.blank? child_step_ids.is_a?(Array) ? child_step_ids : JSON.parse(child_step_ids) end |
#has_children? ⇒ Boolean
48 49 50 |
# File 'app/models/tasker/step_dag_relationship.rb', line 48 def has_children? child_count.positive? end |
#has_parents? ⇒ Boolean
44 45 46 |
# File 'app/models/tasker/step_dag_relationship.rb', line 44 def has_parents? parent_count.positive? end |
#leaf_step? ⇒ Boolean
40 41 42 |
# File 'app/models/tasker/step_dag_relationship.rb', line 40 def leaf_step? is_leaf_step end |
#parent_step_ids_array ⇒ Object
Parse JSONB arrays for relationship access
53 54 55 56 57 |
# File 'app/models/tasker/step_dag_relationship.rb', line 53 def parent_step_ids_array return [] if parent_step_ids.blank? parent_step_ids.is_a?(Array) ? parent_step_ids : JSON.parse(parent_step_ids) end |
#readonly? ⇒ Boolean
Read-only model backed by database view
9 10 11 |
# File 'app/models/tasker/step_dag_relationship.rb', line 9 def readonly? true end |
#root_step? ⇒ Boolean
Helper methods for DAG navigation
36 37 38 |
# File 'app/models/tasker/step_dag_relationship.rb', line 36 def root_step? is_root_step end |