Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/ki/helpers.rb

Instance Method Summary collapse

Instance Method Details

#stringify_idsObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ki/helpers.rb', line 24

def stringify_ids
  self.collect do |e|
    if e['_id']
      e['id'] = e['_id'].to_s
      e.delete('_id')
    end
    if e[:_id]
      e['id'] = e[:_id].to_s
      e.delete(:_id)
    end
    e
  end
end