Class: Observ::Dataset
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Observ::Dataset
- Defined in:
- app/models/observ/dataset.rb
Instance Method Summary collapse
-
#active_items ⇒ Object
Returns only active items for running evaluations.
- #active_items_count ⇒ Object
-
#agent ⇒ Object
Returns the agent class constant.
-
#items_count ⇒ Object
Count helpers for UI.
- #last_run ⇒ Object
- #runs_count ⇒ Object
Instance Method Details
#active_items ⇒ Object
Returns only active items for running evaluations
22 23 24 |
# File 'app/models/observ/dataset.rb', line 22 def active_items items.active end |
#active_items_count ⇒ Object
31 32 33 |
# File 'app/models/observ/dataset.rb', line 31 def active_items_count items.active.count end |
#agent ⇒ Object
Returns the agent class constant
17 18 19 |
# File 'app/models/observ/dataset.rb', line 17 def agent agent_class.constantize end |
#items_count ⇒ Object
Count helpers for UI
27 28 29 |
# File 'app/models/observ/dataset.rb', line 27 def items_count items.count end |
#last_run ⇒ Object
39 40 41 |
# File 'app/models/observ/dataset.rb', line 39 def last_run runs.order(created_at: :desc).first end |
#runs_count ⇒ Object
35 36 37 |
# File 'app/models/observ/dataset.rb', line 35 def runs_count runs.count end |