diff options
Diffstat (limited to 'lib/banzai/reference_parser/base_parser.rb')
-rw-r--r-- | lib/banzai/reference_parser/base_parser.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/banzai/reference_parser/base_parser.rb b/lib/banzai/reference_parser/base_parser.rb index 2058a58d0ae..52fdb9a2140 100644 --- a/lib/banzai/reference_parser/base_parser.rb +++ b/lib/banzai/reference_parser/base_parser.rb @@ -134,9 +134,7 @@ module Banzai ids = unique_attribute_values(nodes, attribute) rows = collection_objects_for_ids(collection, ids) - rows.each_with_object({}) do |row, hash| - hash[row.id] = row - end + rows.index_by(&:id) end # Returns an Array containing all unique values of an attribute of the @@ -210,7 +208,7 @@ module Banzai grouped_objects_for_nodes(nodes, Project, 'data-project') end - def can?(user, permission, subject) + def can?(user, permission, subject = :global) Ability.allowed?(user, permission, subject) end |