projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2871: get collections methods return all collections for the given uuid.
[arvados.git]
/
apps
/
workbench
/
app
/
controllers
/
application_controller.rb
diff --git
a/apps/workbench/app/controllers/application_controller.rb
b/apps/workbench/app/controllers/application_controller.rb
index df41884bac3ec2f5fe07e5447d36068a05fc8055..e39d7760f45ccbc3a7a0e03a8f43c2b2045300c7 100644
(file)
--- a/
apps/workbench/app/controllers/application_controller.rb
+++ b/
apps/workbench/app/controllers/application_controller.rb
@@
-494,12
+494,11
@@
class ApplicationController < ActionController::Base
return @objects_map_for[dataclass]
end
return @objects_map_for[dataclass]
end
- # helper method to get collection for the given uuid
- helper_method :get_collection
- def get_collection uuid
+ # helper method to get collection
s
for the given uuid
+ helper_method :get_collection
s
+ def get_collection
s
uuid
preload_collections([uuid])
preload_collections([uuid])
- (@all_collections_for[uuid] && @all_collections_for[uuid].first) ?
- [@all_collections_for[uuid].first] : []
+ @all_collections_for[uuid]
end
# helper method to preload collections for the given uuids
end
# helper method to preload collections for the given uuids
@@
-521,14
+520,13
@@
class ApplicationController < ActionController::Base
end
end
end
end
- # helper method to get log collection for the given log
- helper_method :get_log_collection
- def get_log_collection log
+ # helper method to get log collection
s
for the given log
+ helper_method :get_log_collection
s
+ def get_log_collection
s
log
fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(log)
uuid = fixup[1]
preload_log_collections([uuid])
fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(log)
uuid = fixup[1]
preload_log_collections([uuid])
- (@all_log_collections_for[uuid] && @all_log_collections_for[uuid].first) ?
- [@all_log_collections_for[uuid].first] : []
+ @all_log_collections_for[uuid]
end
# helper method to preload collections for the given uuids
end
# helper method to preload collections for the given uuids
@@
-551,7
+549,7
@@
class ApplicationController < ActionController::Base
end
# TODO: make sure we get every page of results from API server
end
# TODO: make sure we get every page of results from API server
- Collection.
limit(100).
where(uuid: uuids).each do |collection|
+ Collection.where(uuid: uuids).each do |collection|
@all_log_collections_for[collection.uuid] << collection
end
end
@all_log_collections_for[collection.uuid] << collection
end
end