I just remembered the second part of my last question...
I have a superclass, Resource, which has two subclasses, TeachingObject and
LearningObject. All the records that are saved are one of the subclasses.
However, i'd like to be able to do a ferret search on Resource and get both
kinds of subclass, like when i do Resource.find(), which returns both kinds.
I'm having problems with the index though: TeachingObject and
LearningObject both have :store_class_name => true, and they have their own
indexes. When i try to build the index for Resource, it crashes with the
following trace, whether i have :store_class_name => true set for Resource
or not. Any ideas, anyone?
thanks, max
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.each_pair
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:130:in
`to_doc'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/object/misc.rb:28:in
`returning'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:124:in
`to_doc'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:19:in
`index_records'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:19:in
`each'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:19:in
`index_records'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:29:in
`measure_time'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:18:in
`index_records'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/ferret_extensions.rb:52:in
`index_model'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/class_methods.rb:79:in
`records_for_rebuild'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/rails/activerecord/lib/active_record/transactions.rb:80:in
`transaction'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/class_methods.rb:74:in
`records_for_rebuild'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/ferret_extensions.rb:51:in
`index_model'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/ferret_extensions.rb:39:in
`index_models'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/ferret_extensions.rb:39:in
`each'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/ferret_extensions.rb:39:in
`index_models'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/local_index.rb:54:in
`rebuild_index'
from
/home/jars/rails/lesson_planner/branches/bundles/vendor/plugins/acts_as_ferret/lib/class_methods.rb:28:in
`rebuild_index'
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk