Skip to content
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

Closed
sgruhier opened this issue Dec 16, 2010 · 16 comments
Closed

Support for MongoId #157

sgruhier opened this issue Dec 16, 2010 · 16 comments

Comments

@sgruhier
Copy link

No description provided.

@sferik
Copy link
Collaborator

sferik commented Dec 16, 2010

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.

@djsun
Copy link

djsun commented Dec 17, 2010

I'm a big fan of Mongoid!

@konklone
Copy link

Why can't RailsAdmin simply support ActiveModel? This would give it support for Mongoid automatically.

@sferik
Copy link
Collaborator

sferik commented Dec 17, 2010

@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).

@ethangunderson
Copy link

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.

@sferik
Copy link
Collaborator

sferik commented Dec 18, 2010

I'm going to close this as a dupe of #105, since integrating OrmAdapter will solve this problem. This will be one of the priorities at the bugmash tomorrow.

@sgruhier
Copy link
Author

Thanks a lot sfreik,I could not make the bugmash :(
I'm sure it will be a great time. I'll follow your commits

@winding-lines
Copy link

I am trying to get rails admin going on Mongoid, going directly to mongoID. You can see my branch here:
https://github.com/yaptv/rails_admin/commits/mongoid

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) -%>

@sgruhier
Copy link
Author

nice to see mongoid port is progressing !!
I just tryied to install it on a current project (only Mongo, no ActiveRecord) and it asked for RailsAdmin::InstallMigrationsGenerator::ActiveRecord when I run rails generate rails_admin:install_admin

@winding-lines
Copy link

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.

@timoxley
Copy link

+1

@tgandrews
Copy link

Has this been completed as I'm still getting issue?

@bkoc
Copy link

bkoc commented Jan 9, 2012

+1

1 similar comment
@akshatpradhan
Copy link

+1

@mshibuya
Copy link
Member

This is already completed(see #1031).

@fungl164
Copy link

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests