Class: Observ::Dataset

Inherits:
ApplicationRecord show all
Defined in:
app/models/observ/dataset.rb

Instance Method Summary collapse

Instance Method Details

#active_itemsObject

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_countObject



31
32
33
# File 'app/models/observ/dataset.rb', line 31

def active_items_count
  items.active.count
end

#agentObject

Returns the agent class constant



17
18
19
# File 'app/models/observ/dataset.rb', line 17

def agent
  agent_class.constantize
end

#items_countObject

Count helpers for UI



27
28
29
# File 'app/models/observ/dataset.rb', line 27

def items_count
  items.count
end

#last_runObject



39
40
41
# File 'app/models/observ/dataset.rb', line 39

def last_run
  runs.order(created_at: :desc).first
end

#runs_countObject



35
36
37
# File 'app/models/observ/dataset.rb', line 35

def runs_count
  runs.count
end