karmi/tire — comment on commit fde674650d736c455417e04e8d936986587f9adc
File:  line 0
By sakrafd:

Hi,

This causes problems when using mongoid and config.allow_dynamic_fields = false. I can workaround it by either allowing_dynamic_fields or by defining these ('_score', '_type', '_index', '_version', 'sort', 'highlight', 'matches') methods on the model. Any idea's on a better fix?

Here's the stack trace:

```
NoMethodError: undefined method `_score=' for #
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/activemodel-3.1.0/lib/active_model/attribute_methods.rb:385:in `method_missing'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes.rb:153:in `method_missing'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes/processing.rb:97:in `send'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes/processing.rb:97:in `process_attribute'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes/processing.rb:25:in `process'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes/processing.rb:23:in `each_pair'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/attributes/processing.rb:23:in `process'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/document.rb:130:in `initialize'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/relations/builders.rb:47:in `building'
from /Users/dfarkas/.rvm/gems/ree-1.8.7-2011.03/gems/mongoid-2.1.5/lib/mongoid/document.rb:127:in `initialize'
from /Users/dfarkas/Projects/git/tmp/tire/lib/tire/results/collection.rb:35:in `new'
from /Users/dfarkas/Projects/git/tmp/tire/lib/tire/results/collection.rb:35:in `results'
from /Users/dfarkas/Projects/git/tmp/tire/lib/tire/results/collection.rb:22:in `map'
from /Users/dfarkas/Projects/git/tmp/tire/lib/tire/results/collection.rb:22:in `results'
```

Thanks!
Dave