Class: IDLookup
- Inherits:
-
Object
- Object
- IDLookup
- Defined in:
- backend/app/model/idlookup.rb
Instance Method Summary (collapse)
Instance Method Details
- (Object) find_by_ids(model, id_maps)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'backend/app/model/idlookup.rb', line 3 def find_by_ids(model, id_maps) filters = {} id_maps.each do |column, ids| if !Array(ids).empty? filters[column] = Array(ids) end end return [] if filters.empty? model.filter(filters).select(:id).map {|record| {'ref' => record.uri} } end |