2009/4/5 kristian <[email protected]>

>
> hello,
>
> my experience with datamapper and rails is the following:
>
> * dm-more/rails_datamapper
>
>  never worked out of the box for me, I put a simple patch on
> lighthouse, but not applied yet. so I "forked" it in
>
>  http://github.com/mkristian/datamapper4rails/tree/master
>
>  and enhanced it whenever I needed it
>
> * cannot find Object 'Item' or something like this, does not work with
> extlib lookup but a simple Object.const_get will do. the work around
> for this is to load all model classes before processing the action
> from the controller. that works fine for me. I put a helper class in
> datamapper4rails. maybe extlib could check Object.const_get as last
> option, but I do not understand this lookup in its detail to judge
> this.


This is because DataMapper is mostly used with Merb, which preloads by
default. On the other hand, Rails tries to preload in development mode. I
wonder, though, what your item.rb file looks like, because it *should* work.


> * if you do not like the cookie session store from rails you have
> nothing left. so put a datamapper_store again into datamapper4rails.
> since I am about to move verything to rails 2.3.2 the store is for
> that version (version an older rails is around somewhere on my
> harddisk). any interest I would be happy to contribute it to
> rails_datamapper.


It would be great if the DataMapper session code could be shared between
Merb and Rails. Would you mind looking at the code in merb_datamapper and
see where it overlaps and whether you can find a way to abstract it so it
can be used for both frameworks (and maybe all frameworks through Rack).


> * if you would like to keep the database consistent (within its
> constraints) then you should wrap a transaction around your actions.
> dito for the identity maps and for this I made two little classes.
> again happy they do not have specs yet)


Does this mean you are wrapping a transaction and repository block around
ever action. Again, it would be great if this could be pulled out into a
middleware that could be shared between Merb and Rails.


>
>
> beside some concurrency issue with mysql, datamapper works great for
> me.
>
> there is a restful adapter in datamapper4rails. when I last look at
> the dm-more/adapter is was not in working state. then I had the choice
> between active_resource and datamapper. since datamapper opened the
> possibilty to reuse the "model" classes for either using it against
> the database or against the restful service, I decided to fix the
> adapter. it works a great way, and it works all the way for my project
> now, missing are single resources (one without primary keys or keys)
> and nesting 'has n' children. belongs_to does work as well manually
> implemented 'has n'. but when I looked to contribute the code, I found
> a lot of changes. sorry for duplicating.


I don't see why ActiveResource wouldn't work with controllers that used DM.
If they do not, the specific details would be extremely helpful :)


>
>
> with regards Kristian


Great job and thanks for your involvement!


>
>
> >
>


-- 
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

--~--~---------~--~----~------------~-------~--~----~
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