Class: InOrder::Fetch
- Inherits:
-
Object
- Object
- InOrder::Fetch
- Includes:
- Aux::SortElements, Aux::VarKeys
- Defined in:
- app/models/in_order/fetch.rb
Overview
Returns a list of elements in order, given a key of Owner and/or Scope.
Instance Method Summary collapse
Methods included from Aux::SortElements
Methods included from Aux::VarKeys
Instance Method Details
#call ⇒ Object
9 10 11 |
# File 'app/models/in_order/fetch.rb', line 9 def call elements.map &:subject end |
#elements ⇒ Object
13 14 15 |
# File 'app/models/in_order/fetch.rb', line 13 def elements sort_elements fetch end |
#fetch ⇒ Object
17 18 19 |
# File 'app/models/in_order/fetch.rb', line 17 def fetch InOrder::Element.fetch_with_key(keys).to_a end |
#repair ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/models/in_order/fetch.rb', line 21 def repair InOrder::Element.transaction do fetch.each do |element| if element.subject.nil? Remove.new(element).call end end end self end |