hi
I have a form that has a category model and and embeded docuement called "FieldModule" and this has embedded document called "SubFieldModule"
For example
class Category
include MongoMapper::Document
key :name, String
many :field_modules
end
class FieldModule
include MongoMapper::EmbeddedDocument
key :name, String ...
Hey,
I'm very new to rails and have been trying to experiment with using Mongodb on a web app.
I have been following this railscast tutorial here word for word and have been running into issues with it not connecting to my local Mongodb.
I'm sure Mongodb is up and running since mongod shows up in my activity monitor and going to
ht...
After some searches, I found the documentation of mongo_mapper is poor.
There is only a short readme on GitHub, only one article in http://mongomapper.com, and just a list of classes in the RDoc.
I know there is a good screencast at http://railscast.com, but I want some more good documents about how to using mongo_mapper.
Are there an...
I properly installed MongoDB and got it running on my OSX. The first app I created using MongDB and Rails3 was titled 'todo". Per the
instructions on railscasts, I created a file (config/initilializers/
mongo.rb) and added this line:
MongoMapper.database = "todo-
#{Rails.env}"
Presumably, this created the files that appeared in my ...
Hi
I have a document with an embedded document in it.
I have 2 forms, 1 that updates fields in document and one that updates fields in emdedded docs.
They are split into 2 forms as lots of fields in each etc and actually this is just a simple example of the structure of my app.
Everywhere else that i reference this data it makes m...
I have a MongoDb database called Northwind. The database was created using C# driver. It contains 10-20 rows. Now, I want to get all those rows out from Ruby. I am using MongoMapper but how can I map a Ruby class "Category" to the "Name" field in the document.
require 'mongo_mapper'
class Category
include MongoMapper::Document
key :...
I am just starting a new Rails 3 project using Mongoid ORM for MongoDB. There is just one thing I can not get my head around, and that is how to effectively have a many-to-many relationship. Now there is a good chance that I may be approaching this problem wrong, but as far as I know, there is at least two containers in my project that...
I would like to get machinist, machinist_mongo, mongo_mapper, cucumber and pickle to play nice together.
Currently I have machinist with all my blueprints configured and am using cucumber to do BDD. So far so good. My problem is I am having to write custom cucumber steps for all of my machinist blueprints. It is not really a problem per...
hi
I have a menu class and that have many menu_items and a menu_item class that is embedded docuemnt.
I can get a specific menu like
menu = Menu.find_by_name("menu 1")
then i want to find and update or create the menu_item that matches a specific category id.
I want to create the menu item if category id is not found in menu items...
I have products as an embedded document inside the category class as shown below:
require 'mongo_mapper'
class Category
include MongoMapper::Document
key :Name, String
key :NumberOfProducts, Integer
many :products
end
and here is the Product class:
require 'mongo_mapper'
class Product
include MongoMapper::EmbeddedDocument
...
hi
is it possible to create / update a locale language yaml file from with a rails application ?
If so is would it be automatically pulled into the load path somehow as i dont want to have to restart to pull in the new changes ?
Is this possble and if so how ?? or is there a better way ?
I am using mongodb as a db.
thanks
rick
...
I have a Rails 3 model "D" that belongs to another model, which belongs to another two in turn, like this:
D belongs to C
C belongs to B
B belongs to A
I am using MongoDB/Mongomapper as my ORM.
When I try to instantiate D, I am getting an error:
ruby-1.9.2-preview3 > d = D.new
SystemStackError: stack level too deep
from /Users/peter...
I've been trying to add to an array (or what ruby is saying is an array), but keep getting an error from mongo which says
Cannot apply $addToSet modifier to non-array
when I try to run
User.collection.update({'id'=> current.id},{'$addToSet'=>{ 'following' => current.id}})
User.collection.update({'id'=> user.id},{'$addToSet'=...
I'm trying to implement Paperclip in my first rails app, and I happen to be using rails 3 and mongodb with mongomapper.
I followed this guide on getting there things to all work together
http://www.bencurtis.com/2009/08/paperclip-and-mongomapper/
Just as the blog post suggests, I've put paperclip into the config/initializers directory,...
Authlogic, by itself, seems to be too active record centric for MongoDB (specifically mongomapper) as per: http://github.com/binarylogic/authlogic/issues#issue/15.
However, there's an interesting authlogic plugin for mongo that looks pretty awesome, and simple.
Has anyone used this, or have any experience/recommendations for an authlo...
Does anyone have a good resource for MongoMapper documentation? I've been reading through the mongoDB docs, but a lot of it doesn't convert across to ruby/mm. I've been trying to figure out how to do a SELECT FROM WHERE EXISTS with little success.
db.things.find( { a : { $exists : true } } ); // return object if a is present
The only ...
i want to store all my assets in mongo gridfs. i was trying to get
carrierwave setup with mongomapper and gridfs but seems carrierwave
supports mongoid now instead.
I need to be able to save different size versions / cropped versions
of an image so thats why i was going to use carrierwave. Currently
its set up to store on file ...
I've got a simple model object:
class UserRating
include MongoMapper::EmbeddedDocument
key :idea_id, ObjectId
key :rating, Integer
end
I'm trying to set an Idea_Id on this object with:
user_rating.idea_id = ObjectId.new
This throws: "illegal ObjectID format"
This sure seems like simple code... The only oddity I am noticing ...
I've got a group of messages in mongo which I am retrieving in rails with
@messages = current_user.user_messages(@user)
I now want to select the number of messages which were created in the last week, so I thought I could take the @messages and query that directly with
@countRecent = @messages.count(:conditions => {:created_at =>{'$...
I'm trying to put together an association that takes advantage of Mongo's document subkey indexing. For example, I have two collections, posts and topics. Posts have a tags key, which is an indexed set of tags for the post - pretty vanilla. What I want to do though, is have something in my Topic model like:
class Topic
key :name, Stri...