Hi,
We're using acts_as_ferret from trunk and my searches crash while in production mode. We hunted it down and discovered that the problem is with acts_as_ferret remote index and STI models.
When the call to acts_as_ferret is processed in the base class, it is registered to the index, and then is available in the ferret server process as a valid Ruby class. When we try to use the subclass, however, it is not registered with the index (since acts_as_ferret is in the base class). The remote index call crashes like this:
NoMethodError: undefined method `[]' for #<DRb::DRbUnknown:0xb768f9cc>
(druby://localhost:9009) /tmp/bli/vendor/plugins/acts_as_ferret/lib/local_index.rb:163:in `determine_stored_fields'
(druby://localhost:9009) /tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:83:in `find_ids'
(druby://localhost:9009) /tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_server.rb:139:in `send'
(druby://localhost:9009) /tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_server.rb:139:in `method_missing'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/remote_index.rb:36:in `find_ids'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/remote_functions.rb:15:in `handle_drb_error'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/remote_index.rb:36:in `find_ids'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:69:in `find_id_model_arrays'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:27:in `ar_find'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:11:in `find_records'
/tmp/bli/vendor/plugins/acts_as_ferret/lib/class_methods.rb:176:in `find_with_ferret'
./test/unit/employee_test.rb:7:in `test_find_with_ferret'
/tmp/bli/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/testing/default.rb:7:in `run'
You'll find attached a small sample rails application with acts_as_ferret installed that shows the problem in its unit tests. To run these tests, first start the server:
./script/ferret_server -e test start
then run the unit tests:
rake test:units
please e-mail us if you need any further information regarding this:
terceiro@colivre.coop.br and moises@colivre.coop.br