Doug
> I would setup your models differently, using Single-Table Inheritance
STI would be impractical (I don't want to add a useless "type"
column), but plain inheritance sounds like a very good idea.
> class Text << ActiveRecord::Base
> acts_as_ferret(... declare all fields here )
> end>
> You'd then subclass this with two other classes:
>
> class EnglishText << Text
> end
> class DutchText << Text
> end
I guess you meant :
class Text << ActiveRecord::Base
end
class EnglishText << Text
acts_as_ferret :fields => [name, text_en]
end
class DutchText << Text
acts_as_ferret :fields => [name, text_nl]
end
That would indeed allow to call :
> EnglishText.find_by_contents("english query")
> DutchText.find_by_contents ("dutch query")
Clean and simple.
Thanks a lot.
Alain Ravet
----
http://blog.ravet.com
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk