To edit pages or tickets please login with username/password: aaf/aaf

Show
Ignore:
Timestamp:
02/18/08 20:36:07 (9 months ago)
Author:
jk
Message:

add :if option to acts_as_ferret method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/demo/app/models/comment.rb

    r321 r324  
    2727  # the :ignore flag tells aaf to not try to set this field's value itself (we 
    2828  # do this in our custom to_doc method) 
    29   acts_as_ferret( :store_class_name => true,  
     29  acts_as_ferret( :if => Proc.new { |comment| comment.do_index? }, 
    3030                  :fields => { 
    3131                    :content => { :store => :yes }, 
     
    3636                  #}, :ferret => { :analyzer => PlainAsciiAnalyzer.new(['fax', 'gsm', 'the', 'or']) } ) 
    3737 
    38   # only index the named fields: 
    39   #acts_as_ferret :fields => [:author, :content ] 
     38  def do_index? 
     39    self.content !~ /do not index/ 
     40  end 
    4041 
    4142  # you can override the default to_doc method  

To edit pages or tickets please login with username/password: aaf/aaf