alexeypetrushin/mongodb_model — Issue #2: Collection uses `pluralize` but no dependencies define it
Author: joefiorini
Created: 2011-12-17 18:50:34+00:00
State: open

I'm trying out mongo/model in IRB to get the feel for it. I defined a class, instantiated it, set some properties and tried to save it. Here's the result:

```shell

irb(main):003:0> require 'mongo/model'
=> true
irb(main):004:0> class Blah
irb(main):005:1> inherit Mongo::Model
irb(main):006:1> end
=> [Mongo::Model]
irb(main):007:0> class Blah
irb(main):008:1> attr_accessor :blah, :diddy
irb(main):009:1> end
=> nil
irb(main):010:0> b = Blah.new
=> #
irb(main):011:0> b.blah = "foo"
=> "foo"
irb(main):012:0> b.diddy = "bar"
=> "bar"
irb(main):013:0> b.save
NoMethodError: undefined method `pluralize' for "Blah":String
from /Users/joe/.rbenv/versions/1.9.2-p290/gemsets/densitypop-api/gems/mongodb_model-2.0.2/lib/mongo/model/db.rb:25:in `default_collection_name'
from /Users/joe/.rbenv/versions/1.9.2-p290/gemsets/densitypop-api/gems/mongodb_model-2.0.2/lib/mongo/model/db.rb:17:in `collection'
from /Users/joe/.rbenv/versions/1.9.2-p290/gemsets/densitypop-api/gems/mongodb_model-2.0.2/lib/mongo/model/crud.rb:107:in `with_collection'
from /Users/joe/.rbenv/versions/1.9.2-p290/gemsets/densitypop-api/gems/mongodb_model-2.0.2/lib/mongo/model/crud.rb:28:in `save'
from (irb):13
from /Users/joe/.rbenv/versions/1.9.2-p290/bin/irb:12:in `

'
```