Casting "insertGetId" as an integer where appropriate. Fixes #377.

Signed-off-by: Ben Corlett <bencorlett@me.com>
Adding ability to guess namespaced model table names. (#389).

Signed-off-by: Ben Corlett <bencorlett@me.com>
Merge pull request #418 from bencorlett/feature/database-insert-get-id

Casting "insertGetId" as an integer where appropriate. Fixes #377.
shortening up some code.