condition_values<<qualifiers
end
indexes = ResourceIndex.find(:all,
- :select => 'resource_id,root_project_id,qualifier', # optimization to not load unused columns like 'kee'
+ :select => 'distinct(resource_id),root_project_id,qualifier', # optimization to not load unused columns like 'kee'
:conditions => [conditions.join(' and ')].concat(condition_values),
:order => 'name_size')
end
resource_ids = ResourceIndex.find(:all,
- :select => 'resource_id',
+ :select => 'distinct(resource_id)',
:conditions => [conditions, values],
:order => 'name_size').map {|rid| rid.resource_id}.uniq
key = search.downcase
results = ResourceIndex.find(:all,
- :select => 'resource_id,root_project_id,qualifier', # optimization to not load unused columns like 'kee'
+ :select => 'distinct(resource_id),root_project_id,qualifier', # optimization to not load unused columns like 'kee'
:conditions => ["kee like ?", key + '%'],
:order => 'name_size')
results = select_authorized(:user, results)
- results = Set.new(results) # do not want the same resource_index to appear many times in the result
@total = results.size
resource_ids=[]
root_project_id
end
- def eql?(another_resource_index)
- resource_id == another_resource_index.resource_id && root_project_id == another_resource_index.root_project_id
- end
-
- def hash
- [resource_id, root_project_id].hash
- end
-
end
\ No newline at end of file