#14 new

cannot use acts_as_ferret with remote index and single table inheritance

Reported by Jens | February 13th, 2010 @ 12:36 AM


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 #
    (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

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket