Ooops...
> def search
> @models = Model.find_by_contents('foo')
> @models.each do |m|
> @model = Model.find(m.id)
> @model.disable_ferret(:once)
> @model.update_attribute('views', if @model.views == 0 then 1
> else @views + 1 end)
> end
> end
>
> This also greatly improved my search speed.
>
> You can read more here ->
> http://projects.jkraemer.net/acts_as_ferret/wiki/AdvancedUsage
>
> Hope this helps someone.
@views in the @model.update_attribute line should be @model.views...
Should proof read better ;)
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk