Method: Dao::Conducer#id

Defined in:
lib/dao/conducer.rb

#id(*args) ⇒ Object

id support



379
380
381
382
383
384
385
386
387
# File 'lib/dao/conducer.rb', line 379

def id(*args)
  if args.blank?
    @attributes[:_id] || @attributes[:id]
  else
    id = args.flatten.compact.shift
    key = [:_id, :id].detect{|k| @attributes.has_key?(k)} || :id
    @attributes[key] = id_for(id)
  end
end