On Wed, Mar 21, 2007 at 01:32:37PM +0100, Linus wrote:
> Hi,
> I have three models: Comatose::Page, Article and Product.
> In all of them, store_class_name is set to true.
>
> Now, when i do:
> results = Comatose::Page.multi_search("*", [Article,Product], options)
> I get:
>
> wrong constant name Comatose::Page
>
> #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/class_methods.rb:438:in
> `const_get'
[..]
> Any idea why I might get that error?
yeah, const_get can't resolve namespaced constant names - this issue is
fixed in trunk. If you don't want to upgrade, replace the call to
const_get with something like
model_class = model_name_string.constantize
(dont know what's the name of the var holding the model's name from the
top of my head)
[..]
> I dont get it with results = Comatose::Page.find_by_contents(q, options)
that's because in this case (one-model query) there is no need to lookup
a class based on the model name stored in the index.
cheers,
Jens
--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk