mongomapper

What is your prefered ODM in Ruby ? MongoMapper, MongoID or MongoDoc ?

In ruby, there are currently 3 ODM maintained: MongoMapper MongoID MongoDoc What is your prefered and why ? ...

MongoDB architectural question

I am using Rails and have to store 4 Models. Let's say a Post that has many and belongs to many Categories. Category on the other hand has many Qualities. At the moment I'm of the opinion, that Post and Categories are Documents. Qualities becomes an embedded Document of Categories. We're coming to the root problem: There are a lot of Vo...

searching for a guide how to setup mongo_mapper, devise, haml with rails3

is there a full setup guide for mongo_mapper, haml, rails3 and devise, for the current git (master) branches? a lot of things changed in all of those frameworks/libs lately. i was wondering if somebody has it up and running and can share it on github or give some pointers... ...

mongo mapper with STI with more than one type?

I have a series of models all which inherit from a base model Properties For example Bars, Restaurants, Cafes, etc. class Property include MongoMapper::Document key :name, String key :_type, String end class Bar < Property What I'm wondering is what to do with the case when a record happens to be both a Bar & a Restaurant? I...

mongomapper, rails3 edge: undefined method `to_key' on form_for

when i am trying to get the basic devise examples running with current git versions from rails, mongomapper and devise, i have the following error appearing: undefined method `to_key' for #<Admin:0x23dee04> here is my actual source: 4: = form_for @admin, :url => admins_path do |f| 5: - field_set_tag 'Update my email' do 6: ...

Creating a form for editing embedded documents with MongoMapper

I'm playing around with MongoMapper but I'm having trouble figuring out how to create a form for an object that has embedded documents. With ActiveRecord, I'd use fields_for but when asked if this would be supported a few months ago, MongoMapper author John Nunemaker wrote: "Nope and nope. It is really [not] that hard with attr_accessor...

How to create this MongoMapper custom data type?

I'm trying to create a custom MongoMapper data type in RoR 2.3.5 called Translatable: class Translatable < String def initialize(translation, culture="en") end def languages end def has_translation(culture)? end def self.to_mongo(value) end def self.from_mongo(value) end end I want to be able to use it l...

rails3, gridfs and mongomapper: how to serve files? send_data?

i am currently developing a rails3 app with mongomapper and file storage in gridfs. after some trying around, i found grip and currently also use it in the app for storing the data. so far, so good - now i am trying to get my head around serving the files to the user -- what would be the best/fastest way to achieve that? from: http://ra...

Anyone knows a good tutorial for using Mongodb or MongoMapper with Ramaze?

Anyone knows a good tutorial for using Mongodb or MongoMapper with Ramaze? Thanks ...

Rails + MongoMapper + EmbeddedDocument form help

I am working on a pretty simple web application (famous last words) and am working with Rails 2.3.5 + MongoMapper 0.7.2 and using embedded documents. I have two questions to ask: First, are there any example applications out there using Rails + MongoMapper + EmbeddedDocument? Preferably on GitHub or some other similar site so that I can...

MongoMapper won't let me create an object

I'm just learning MongoDB and MongoMapper. This is on Rails 3. I created a blog in app/models/blog.rb: class Blog include MongoMapper::Document key :title, String, :required => true key :body, Text timestamps! end I go into the Rails console: rails c Loading development environment (Rails 3.0.0.beta) ruby-1.9.1-p378 > b = ...

Understanding MongoDB (and NoSQL in general) and how to make the best use of it

Hello, I am beginning to think that my next project I am wanting to do would work better with a NoSQL solution. The project would either involve a ton of 2-column tables or a ton of dynamic queries with dynamically generated columns in a traditional SQL database. So I feel a NoSQL database would be much cleaner. I'm looking at MongoDB ...

How to mix mongodb and a traditional db in Rails?

I am considering using MongoDB (mongo-mapper) for a portion of my rails application. I am not ready to go whole hog MongoDB because there are too many useful gems that depend on a traditional DB. That being said there are parts of my application that would be great to leverage a document database. Has anyone had success mixing the two...

MongoDB Embedded Documents / Documents with Rails

Hello all, I've recently begun playing around with MongoDB on Rails through use of the MongoMapper gem. I was wondering if there is some sort of way to have a class/object/collection be both a Document as well as an Embedded Document. I want the same entity to be both included/embedded in other documents, and also be able to exist on i...

Using MongoDB with Ruby On Rails and the Mongomapper plugin

Hello, i am currently trying to learn Ruby On Rails as i am a long-time PHP developer so i am building my own community like page. I have came pritty far and have made the user models and suchs using MySQL. But then i heard of MongoDB and looked in to it a little bit more and i find it kinda nice. So i have set it up and i am using mong...

Rails and MongoDB with MongoMapper

I'm new to Rails development and I'm starting with MongoDB also. I have been following this Railscast tutorial about complex forms with Rails but I'm using MongoDB as my database. I'm having no problems inserting documents with it's childs and retrieving the data to the edit form, but when I try to update it I get this error undefi...

Mongomapper - bootstrapping techniques

I've just begun creating a rails application using mongomapper for my models. I'm wondering what solution should I use for bootstrapping my app with it. All my previous experience is with ActiveRecord & PostgreSQL, in which I have used several gems for bootstrapping. The one I liked the most was bootstrapper (+ factorygirl + faker). Do...

how to have separate keys per record in mongo_mapper + Rails

When I'm adding a record in mongodb I can specify whatever keys I want and it will store it in the db. The problem is that it will remember those keys for the next time I insert another record. so for example if I do the following: Product.create :foo => 123 and then Product.create :bar => 456 I get :foo => nil field in the 2nd rec...

Wrapping my head around MongoDB, mongomapper and joins...

I'm new to MongoDB and I've used RDBMS for years. Anyway, let's say I have the following collections: Realtors many :bookmarks key :name Houses key :address, String key :bathrooms, Integer Properties key :address, String key :landtype, String Bookmark key :notes I want a Realtor to be able to bookmark a House and/or a ...

MongoMapper and bson_ext problem

I can't get MongoMapper to work with my Rails app. I get this error message: **Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance. You can install the extension as follows: gem install bson_ext If you continue to receive this message after installing, make sure that the bson_ext gem is in...