-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for MongoId #157
Comments
I would very much like to RailsAdmin to support MongoId but I don't know enough about Mongo to write the code myself or whether its even possible. As a general goal, RailsAdmin should support multiple ORMs. MerbAdmin supported DataMapper and Sequel (in addition to ActiveRecord) but it became rather burdensome to maintain adapters for each ORM. Ideally, there would be an abstraction for talking to different Ruby ORMs in a unified way, like an expanded ActiveModel. |
I'm a big fan of Mongoid! |
Why can't RailsAdmin simply support ActiveModel? This would give it support for Mongoid automatically. |
@klondike Good question. ActiveModel isn't currently broad enough to cover all the cases where RailsAdmin talks to ActiveRecord. I've been looking at using OrmAdapter to solve this problem (see #105). OrmAdapter currently supports ActiveRecord, DataMapper, and MongoId, which wouldn't solve the problem completely but it would give us a beachhead. I am not a MongoId user myself, but I would strongly encourage you to addend the bugmash event tomorrow (even if only as a tester, that would be a big help). |
I'm really interested in getting this done. Unfortunately, I'm not available for the bugmash tomorrow, but if this doesn't get done then, I'll do it afterwards. |
Thanks a lot sfreik,I could not make the bugmash :( |
I am trying to get rails admin going on Mongoid, going directly to mongoID. You can see my branch here: My application uses both mysql and mongodb. The code has still a way to go, at this time both sets of models are identified in the application. The objects in a given model are list-ed. Selecting Edit generates an error around line 14 undefined method `model_name' for Mongoid::Criteria:Class 11: </div> 12: </div> 13: <%= render(:partial => 'layouts/rails_admin/flash', :locals => {:flash => flash}) -%> 14: <div id="contentMainNew"> 15: <%= form_for(@object, :url => rails_admin_update_path(:model_name => @abstract_model.to_param, :id => @object.id), :html => { :method => "put", :multipart => true }) do %> 16: <fieldset> 17: <%= render(:partial => 'form_section', :collection => RailsAdmin::config(@object).edit.visible_groups) -%> |
nice to see mongoid port is progressing !! |
My application is a dual application, mysql and mongodb/id. The Active Record parts are used by Rails Admin to store the History of the actions on the admin, removing Active Record altogether is more complicated. I am sure that part can be ported to Mongoid if there is enough interest, it is not a high priority for my current project. |
+1 |
Has this been completed as I'm still getting issue? |
+1 |
1 similar comment
+1 |
This is already completed(see #1031). |
I'm pretty new to this and I may be posting in the wrong place... but since I could not get the RailsAdmin history to work out-of-the-box using just mongoid, I did a quick fix of the internal RailsAdmin::History and it now seems to be working... :) Patch is here -> https://github.com/fungl164/rails_admin/blob/master/lib/rails_admin/extensions/history/history.rb |
No description provided.
The text was updated successfully, but these errors were encountered: