I see what your saying Tony, there a certain benefit to using the return of #create to identify the result of the process.
> As I mentioned in an earlier post, my suggestion is that one uses create() > when all validations are expected to pass, and new/save in all other cases. An alternative use case is to use #create when all the attributes have already been collected into a hash. I feel like a nil returning #create make some uses cases easier while making other lengthy-er, which in my mind isn't win win enough to motivate change in public api. purely opinion. On Dec 15, 1:36 pm, "Tony Mann" <[email protected]> wrote: > > If create returns nil, then how do you figure out why the save failed? > > > Earle > > As I mentioned in an earlier post, my suggestion is that one uses create() > when all validations are expected to pass, and new/save in all other cases. > > Another way of putting this: create() is supposed to provide a quickie way > to create a saved model instance. If you are checking for errors, it's not > quickie :-) > > ..tony.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
