thanks jan, both good suggestions. when time permits i might try the second. for now i'm using a ridiculous hack, but it's working: i let the create method do it's thing, then if the 'private' flag is set, i call ferret_destroy for it. a lot of useless overhead, to add to the index then immediately remove from it, but since this db is read much more than it's written to, this will at least hold us over for a while.
best, john Quoting Jan Prill <[EMAIL PROTECTED]>: > Hi, John, > > this might be wrong since I'm no expert in acts_as_ferret. But I've scrolled > through > http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/acts_as_ferret.rb > and maybe it's only me and you but I don't see a "keep_private" kind of flag > in acts_as_ferret.rb either. > > So IMHO you've got two choices: > > 1. Without changes on acts_as_ferret.rb you might add a field "keep_private" > to your model which you set to the user_id (or even better a salted hash) of > your users if they set it to true or leave it to the default '0'. Then in > your queries you issue a query that returns only results where keep_private > is set to '0' OR your user_id (or the salted hash). This should return only > documents that are either public or created by the current user. > > 2. If this is too insecure in your opinion (because you don't trust that no > documents would leak out) and you definitly want to keep private documents > from being indexed (which of course means that they aren't searchable for > the original creator either) then IMHO your best bet would be to fiddle > around with acts_as_ferret.rb yourself (it's quite good documented) or > overwrite it's instance methods in your model. You might then add a small > check on the ferret_create for example if the model is private and therefore > needs to skip the indexing. > > Cheers, > Jan > > > > > > > On 6/17/06, John McGrath <[EMAIL PROTECTED]> wrote: > > > > > > Hi, this is hopefully an easy one, but I've gone through the api and > > > searched > > > past forum entries, and am drawing a blank. > > > > > > I have a model that with acts_as_ferret mixed in to it, which is working > > > fine. > > > But I want users to be able to set a 'private' attribute on the model, > > > and when > > > it's set to true, create and update methods would skip indexing. So, how > > > can I > > > prevent indexing of a usuaully-indexed model? > > > > > > Any help greatly appreciated. > > > > > > John > > > > > > ---------------------------------------------------------------- > > > This message was sent using IMP, the Internet Messaging Program. > > > > > > _______________________________________________ > > > Ferret-talk mailing list > > > [email protected] > > > http://rubyforge.org/mailman/listinfo/ferret-talk > > > > > > > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

