Skip to content

Commit

Permalink
Autofix rubocop issues
Browse files Browse the repository at this point in the history
Autofix rubocop issues
  • Loading branch information
Ladas committed Feb 21, 2017
1 parent c079e57 commit 7912ea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/models/manager_refresh/inventory_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def extract_references(new_references = [])
# which is equivalent to "col1 IN [a,b] AND col2 IN [e,f]". The best would be to forcing rails to query
# "(col1, col2) IN [(a,e), (b,f), (b,e)]" which would load exactly what we need. Postgree supports this, but rails
# doesn't seem to. So for now, we can load a bit more from the DB than we need, in case of manager_ref.count > 1
hash_uuids_by_ref = manager_ref.each_with_object({}) {|x, obj| obj[x] = [] }
hash_uuids_by_ref = manager_ref.each_with_object({}) { |x, obj| obj[x] = [] }

# TODO(lsmola) hm, if we call find in the parser code, not all references will be here, so this will really work
# only for lazy_find. So if we want to call find, I suppose we can cache all, possibly we could optimize this to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def hardwares(extra_attributes = {})
[hardware.vm_or_template.ems_ref]
end

attributes[:custom_db_finder] = lambda do |inventory_collection, selection, _projection |
relation = inventory_collection.parent.send(inventory_collection.association).
includes(:vm_or_template).
references(:vm_or_template)
attributes[:custom_db_finder] = lambda do |inventory_collection, selection, _projection|
relation = inventory_collection.parent.send(inventory_collection.association)
.includes(:vm_or_template)
.references(:vm_or_template)
relation = relation.where(:vms => {:ems_ref => selection[:vm_or_template]}) unless selection.blank?
relation
end
Expand Down

0 comments on commit 7912ea9

Please sign in to comment.