Hi Richard,

Thanks for responding, I really appreciate it.

Surrounding the sim.create calls with a rescue block does nothing - no
exceptions are raised. So, rather than creating instances, I tried
initializing them, setting 'raise_on_save_failure' to false, then
saving them, but as expected the exception raised just states that
sim.save returned false and the model was not saved.

Models only have the 'errors' method when dm-validations is used, and
since I'm not doing any validating, no errors exist on the model when
I do require dm-validations.

I'm assuming I have all the DM dependencies I need required, otherwise
I'd get an error saying something about uninitialized constants or
similar messages.

I could not find the conversation on Ruby Talk that you mentioned... :
(

I've updated my Gist at https://gist.github.com/0a77160612394a0ecc67
with the changes I made (along with logging output) if you want to
peek at it again... you should even be able to execute the code if you
have a Postgres DB setup. Something is keeping the model from being
written to the database for some reason, and I just don't know how to
figure out what that reason is... :(
--
Bryan

On Jun 22, 6:21 pm, Richard Conroy <[email protected]> wrote:
> On Wed, Jun 23, 2010 at 1:10 AM, Bryan Richardson <[email protected]> wrote:
> > Hi All,
>
> > I'm having problems with using the property type UUID in DataMapper
> > with a Postgres database. I try to save the model and it's failing,
> > but I can't tell why.
>
> > I have some example code here...
> >https://gist.github.com/0a77160612394a0ecc67
>
> > Note that in my example code, the System model saves just fine but the
> > Simulations model doesn't.
>
> Bryan,
>      I would recommend that you surround the sim.create call with a rescue
> block, and
> inspect any exceptions that get thrown.
>
> Also, instead of calling sim.saved? at the end, you could call sim.errors to
> get a collection
> of error messages. It might expose more debug information.
>
> Also note that DM code has been refactored between multiple gems and
> dependencies.
> You may need to have more require statements in 1.0 that you didn't need in
> 0.10.x or
> 0.9.x
>
> I can't help you much besides this, but the question of DataMapper and UUID
> types was asked
> on Ruby-Talk 2 weeks ago (dont know if it was fully resolved).
>
> regards
> --http://richardconroy.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to