Permalink
Browse files

changed uuid libraries, updated rebar.config accordingly

  • Loading branch information...
1 parent 04ac3ed commit ae8898b773e26db38b3f26c39949466daf13fac5 @bunnylushington bunnylushington committed Sep 19, 2012
Showing with 7 additions and 3 deletions.
  1. +2 −1 rebar.config
  2. +1 −1 src/boss_db_mock_controller.erl
  3. +4 −1 src/db_adapters/boss_db_adapter_pgsql.erl
View
@@ -9,5 +9,6 @@
{mysql, ".*", {git, "git://github.com/dizzyd/erlang-mysql-driver.git", {tag, "16cae84b5e"}}},
{poolboy, ".*", {git, "git://github.com/devinus/poolboy.git", {tag, "855802e0cc"}}},
{riakc, ".*", {git, "git://github.com/basho/riak-erlang-client", {tag, "1.3.0"}}},
- {tiny_pq, ".*", {git, "git://github.com/evanmiller/tiny_pq", {tag, "HEAD"}}}
+ {tiny_pq, ".*", {git, "git://github.com/evanmiller/tiny_pq", {tag, "HEAD"}}},
+ {uuid, ".*", {git, "git://gitorious.org/avtobiff/erlang-uuid.git", "master"}}
]}.
@@ -49,7 +49,7 @@ handle_call({save_record, Record}, _From, [{Dict, IdCounter}|OldState]) ->
TypeString = atom_to_list(Type),
{Id, IdCounter1} = case Record:id() of
id -> case keytype(Record) of
- uuid -> {lists:concat([Type, "-", uuid:to_string(uuid:v4())]), IdCounter};
+ uuid -> {lists:concat([Type, "-", uuid:to_string(uuid:uuid4())]), IdCounter};
_ -> {lists:concat([Type, "-", IdCounter]), IdCounter + 1}
end;
ExistingId ->
@@ -159,7 +159,10 @@ infer_type_from_id(Id) when is_list(Id) ->
maybe_populate_id_value(Record) ->
case boss_record_lib:keytype(Record) of
- uuid -> Record:set(id, uuid:to_string(uuid:v4()));
+ uuid ->
+ UUID = uuid:to_string(uuid:uuid4()),
+ io:format("UUID is ~p~n", [UUID]),
+ Record:set(id, UUID);
_ -> Record
end.

0 comments on commit ae8898b

Please sign in to comment.