First of all great job on active_admin! Impressive and really easy to get up and running.
Any plans to support other ORMs like Mongoid?
Yes this is definitely something on our Roadmap. So we've got a few requests for Mongoid. Any other specific ORMs for "official" support?
First, thanks for the gem @gregbell!
+1 for Mongoid so I can use active_admin on my current project.
How about using something more abstract for db support?
Yes agreed. We'll have to abstract the concept of data stores and data access. I'm just trying to get a sense for which ORMs people are interested in "Out of the Box".
+1 for Mongoid. That'd be a big help for me.
@jc00ke Thanks for the suggestion. This seems like a great starting point.
Datamapper support would be awesome too.
+1 for mongoid support
+1 for Mongoid support
I think (and I might be open to flame-bait here) that the most widely used NoSQL database for primary datastore for apps is mongodb. As for the ODM my impression is that Mongoid seems to be the more popular one. Therefore I would say that Mongoid would be head on the NoSQL list.
Maybe github needs polls ;)
+1 for mongoid!
Over in RailsAdmin land, they're considering using either OrmAdapter or Veneer in order to support a wider range of options.
+1 for Mongoid
Yes, this would be so awesome. +1
If you want a poll, then I'd definitely vote for mongoid :)
+1 for mongoid.
Second @drewda's OrmAdapter suggestion, especially since it's already a dependency of devise.
+1 for mongoid
Also interested in this (for DataMapper).
From a quick look into taking a stab at it, ORM adapter probably needs to be extended to be aware of more data (types of columns, being able to enumerate assocations on a model). Also, InheritedResource is pretty coupled to ActiveRecord and its finders would probably need to be overridden (and/or ORM adapter also needs to abstract out the ability to query on collections).
Veneer is probably a better starting point, currently, since it has support for introspecting the associations on a model. https://github.com/kaapa/veneer/commits/properties
+1 for DataMapper
Why not just do it via ActiveModel?
ActiveModel doesn't support querying & introspection (of a table/collection); it's just a consistent representation of the individual resources - and gives you all those nice helpers, like validation
Hmm, I guess I'm just thinking about the presentation, rather than the other side of it too.
+1 for Mongoid, please =)
I'm interested in picking this up for DataMapper. To follow on from @nevir's comment, it looks like one way to get started would be to build support for DM/other ORMs low-down into inherited_resource/ has_scope, given that ActiveAdmin is built on, and strongly coupled to these gems.
+1 for Mongoid
What's the status? (+1 Mongoid)
+2 for Mongoid !
@myabc Thanks, I know how/when to use the fork button. As a matter of fact, I've even indirectly contributed to AA via that same fork button on Kaminari.
I think that asking what the status is is entirely fair considering the following comment from @gregbell himself:
"Yes this is definitely something on our Roadmap." (Dated ~2 months ago)
I'd love to contribute directly to AA but I simply don't have the time to commit right now.
+1 for Datamapper / Generic ORM-Support
And I would like to get my hands dirty in participating in a generic orm-adapter solution. My toughts about it:
Are there better ideas around?
@mbj That seems like a great plan for getting started.
The first thing we should do is a brief audit of the existing Active Admin code base to document all the features the data store will have to support. I would like to see Active Admin define the public API required for adapters to implement the existing features. Then we can make a decision on which generic ORM to use.
From my perspective, the biggest hurdle will be the filtering, scoping and "belongs_to" behavior on the index screens. We will need to write adapters for any support data store, but it needs to start with documenting the API.
I'm really tight for time, so if anyone has a chance, maybe we could start a wiki page that starts to document a plan
Sorry for reacting not that fast.
I'll first start to read the source "in depth" and make sure I understand the hurdles you mentioned. After that I'll try to start an adapter API description. Gist based. After that we can decide to use the ORM-Adapter with the biggest "already works" part. Im sure we have to extend one of the already existing ORM-Adapters. We should start to talk to the ORM authors to make sure our requirements get their support.
As I'm really tight for time too, do not expect results this week ;)
+1 for Mongoid.
@mbj, my suggestion would be to consider the orm_adapter gem you mentioned earlier, it's already being used by Devise, which gives it an slight advantage over veneer. As for the supported ORMs, it supports both ActiveRecord, DataMapper and Mongoid rather than the (according to Ruby-Toolbox and the spam in this topic) less used MongoMapper.
As far as I can tell from my brief looks through the code of active_admin and Veneer/OrmAdapter's api's, the major issue would indeed be the lack of scopes, which are used rather extensively throughout the code. Including support for the belongs_to-behavior should be rather easy to solve in comparison I think, requiring a small extension (contribution?) to the adapter's classes.
Can't wait for this to support Mongoid, congratulations on an amazing project however. I'm tempted to switch back to SQL just to play with it on my latest project.
+1 for Mongoid (whats the status?)
@nextpulse The problem with orm_adapter is that it's focused on abstracting the query interfaces - but not introspection. To make it useful for active admin, we'd need to build in support for that.
@kaapa's properties branch of veneer is probably the best starting point: https://github.com/kaapa/veneer/tree/properties
+1 for MongoId!!
using mongoid, watched Ryan Bates's newest video, tried the gem, didn't work, so a friendly vote for +1 Mongoid!
+1 Mongoid. Also just watched the Ryan Bates screencast - would LOVE to use this for a couple companies I work for but they're all using mongoid.
I see back in June support for other ORMs was on the roadmap. Any updates as to where on the roadmap?
@gregbell Sorry for not reacting that fast. Daily business is hard ;) I'm currently purging rails from my default development stack moving on to other targets. So I cannot invest time in active_admin to build support for datamapper (my favorite orm). I canceled my plans to port active_admin to orm adapter. Sorry.
I would like to see Mongoid support
It will be great to have datamapper support!
Mongoid can be useful too =)
It would be very hard to get the filters working, because meta_search supports only ActiveRecord.
Maybe we could start by adding support without the filters and comments. Working example with Mongoid - https://github.com/ebeigarts/mongoid_active_admin_app
@ebeigarts - great stuff - this works. One needs to define all the fields manually but it's a bit step forward!
+1 for datamapper!! :)
+1 for mongoid ;)
great job folks!
+1 for MongoID :)
+1 for ActiveResource support
@yuki24 has said on Twitter that he has got it to work and will be adding a pull request to the main repo soon.
Fingers crossed it will be soonish.
Hey there! as I tweeted a few days ago, I did make adtiveadmin work with mongoid but what I did was just modifying some lines.
so right now I'm rewriting it with Rspec/Cucumber test and preparing for a pull request.
You can see the current change here: yuki24@master...enable_mongoid
index_as_table and show already work and tested with RSpec and Cucumber. Deletion works but has not been tested yet.
also I'm working on adding orm_adapter to make it easier to support other mappers as discussed above.
try the branch if you have time and give me your feedback. Thanks!
I will give this a try soon. I saw your fork/branch yesterday but didn't think it was ready for testing yet.
My app is mongoid only and does not require active_record (that is no sql database, only a mongo one)
I made local edits from your code (I dropped a comment on #96bf39) to have app go further
rails g active_admin:install --skip-users failed on assets
rails g active_admin:install --skip-users
cause is : comments require a database, which I have not
disabling comments in config/initializers/active_admin.rb enables rails generate active_admin:assets
rails generate active_admin:assets
config.allow_comments_in = 
Generating assets should not require a database ... (looking like a famous issue on heroku cedar with rake assets:precompile :)
I had to do some more edits in initializer to fit into its authentication path, and I'm glad I found them easily
Then, admin interface shows up
This is great
Here are the gotchas I faced :
I forked your fork, and will see how I can help
@yuki24 @thierryhenrio You guys have seen @ebeigarts fork right? It code for a working mongoid active admin (except without comments and filtering). I've gotten create, update, destroy, sort working based off of that fork with mongoid. All that he did was add an initializer (active_admin_mongoid_patchets.rb) to disable commenting and filtering and update sorting.
What is difficult are the filters because they're reliant on meta_search which is active record only right now. I also think decent support for embedded documents needs to be added in before it's really useful.
@thierryhenrio thank you for the feedback! I'll try fixing rails generate active_admin:assets. also AcitveAdmin with only Mongoid is interesting so I will also try implementing it.
@marbemac yes, I've seen that fork from @ebeigarts. he posted some comments on my codelines as well and I totally agree with what he said. also I know that many things depend on active_record but that is what I am trying to solve. support for embedded documents sounds really nice.
@yuki24, I finally made a fresh fork...https://github.com/thierryhenrio/active_admin/tree/mongoid
(spec were red, and begin from green was easier for me)
there are 3 commits
implementation is heavily inspired by your code and @ebeigarts insights
I picked orm_adapter, and it might not be that a good fit to active_admin context ...
I went from a fresh mongoid app, and add step beginning from cli, with rspec+cucumber being green
next goal : have fields showed in a default mongoid form (if can be:)
+1 on Redis. Would be awesome to able someow edit translations, stored with Redis, via ActiveAdmin.
Mongoid is quite popular for NoSQL in Rails.
Does any official roadmap for Mongoid integration exist ?
@erickreutz there is a link below: enable notifications for this issue for these purposes.
enable notifications for this issue
@ognevsky oh my bad. Sorry about that.
Anyone have an updated patch for Mongoid? Looks like the patch from @moa3 is out of date. I'm getting an error when sorting columns: wrong number of arguments (0 for 1).
activeadmin (0.4.2) lib/active_admin/helpers/scope_chain.rb:15:in scope_chain'
activeadmin (0.4.2) lib/active_admin/resource_controller/collection.rb:93:inscope_current_collection'
activeadmin (0.4.2) lib/active_admin/resource_controller/collection.rb:93:in
I dug around a bit more. Looks like I had a model with a scope called :open AND a method with the same name. The scope chain ended up attempting to call my model's method instead of the mongoid mixin. Renaming it to :opened made the problem disappear.
I get the following error with activeadmin(0.4.2) and @moa3 's patch.
ActionView::Template::Error (undefined method reorder' for :Array):
1: render renderer_for(:index)
mongoid (2.4.3) lib/mongoid/criteria.rb:384:inmethod_missing'
activeadmin (0.4.2) lib/active_admin/views/pages/index.rb:41:in `items_in_collection?'
reorder' for :Array):
1: render renderer_for(:index)
mongoid (2.4.3) lib/mongoid/criteria.rb:384:in
I also ran into this error. Here's a fork of @moa3 's patch with a quick fix:
Thank you. I will try it and get back to you.
Thankyou @nanobeep . It worked!!!
@mattvague is the work on multi-ORM (and on extracting Arbre) being done on some branch?
…or I should rather start one myself?
In the meanwhile I've released activeadmin-mongoid, that incorporates an analogous hack.
Any contribution or feedback is welcome :)
@ella perfect! also works with 0.4.3.
Two things I added to make delayed_job jobs manageable.
@stigi thank you!
(I'm @elia, btw)
@elia uh, sorry :) time to clean my screen ;)
Any recent thoughts on Datamapper support?
+1 for mongoid (need a special button for this ;-)
Hey, all. +1s no longer add to this discussion. The overwhelming support has been made clear. Multi-ORM support is on the feature roadmap. Sorry to complain -- Yes, I could just disable notifications, except then I'd miss out on any actual discussion. (And the roadmap links to this page for that exact purpose.)
For impatient +1-ers, check this out (kudos to all who have contributed):
I've just posted a pull request to ActiveAdmin-Mongoid to support search filters. Hopefully this helps someone! elia/activeadmin-mongoid#15 or get the full version from https://github.com/simplybusiness/activeadmin-mongoid (if/until the pull request is merged).
Hi all, I'm interested in working on adding support for other ORMs and I looked Active Admin code base for sometimes but I'm not quite sure where to start. AA depends on Inherited Resources to perform CRUD operations. Is it a good idea to make IR support multiple ORMs first? Advices from anybody would be appreciated, especially from @gregbell and other AA contributors.
closed, yet still a +1 for mongoid
another +1 for Mongoid
You guys need to work on your skills. 2/5
But seriously, if so many people want this, why don't you build it? This is open source, after all.
I would be interested in developing this for DataMapper (either v1 or v2) but could someone tell me how much work that would entail? Is Active Admin geared towards supporting different backends already and have there been people who have taken a shot at this?
I'm also thinking about developing this for DataMapper, maybe soon will try it out and see how much work will be required.
Well at least this hasn't devolved into meme images.
would surely go with mongoid +1
+1 for Riak/Ripple just because I'm trying to get that combo to work for a client right now. :-)
currently it's +102 for mongoid.
I'd add my own +1 for mongoid
so it's 103 +1s
Well at least this hasn't devolved into meme images.
@Daxter sounds like a call to action 😎
A call to action for someone to either dedicate time or money towards this, yes. 🐙
Speaking of time, if anyone wants their ORM of choice supported and is willing to spend some time pair programming with me, let me know!
@Daxter I'd love to do that, especially porting stuff from activeadmin-mongoid, but sadly have no time these days
I would've liked to join you, however, I'm currently not on a Ruby/Rails project and my time is needed elsewhere. So, sadly, I cannot help.
I have a large amount of free time and I have a few other people who would be willing to help with getting ActiveResource working with AA
@elia & @spockz, no worries :)
@rottmanj, great! Except, what do you mean by ActiveResource? It's our reliance on ActiveRecord that's the problem.
I am referring g to adding activeresource support within active admin.
There was a request for this in #39
I still don't know what you mean by that. Could you elaborate?
Right now you can not use a model that inherits from active resource as a resource with in active admin.
How are you guys ( @rottmanj ) on the ActiveResource with AA? It would suit my needs perfectly :) +1
+1's on this only help to make myself and other maintainers more stressed about this topic. Please either help or donate.
+1 mongoid.... fast fast
@candreoliveira did you not see my comment above? You can help by donating time or money.
+1 for Riak with Ripple. As I didn't get any working Activeadmin in Riak based application.
Broken filters & passive maintenance
+1 mongo id
+1 mongo id
Go to #2714 to test Mongoid integration instead of 👍ing this ticket.