27
27
command_map = {'create' => 'new', 'need' => 'find_or_initialize_by_', 'shoud_have' => "find_#{qty}by_", 'find' => "find_#{qty}by_", 'find or create' => 'find_or_initialize_by_'}
28
28
comm_ext, arguments = prepare_args(args)
29
30
if command_map[action] == 'create'
30
31
if oclass.send(('find_by_'+comm_ext).to_sym, *arguments)
31
32
raise "Error object allerady exist if this is not the wished behavior please use need keyword"