aaw/mongoid_fulltext — Issue #30: update_ngram_index  didn't work for me
Author: create-marcel
Created: 2011-11-04 19:14:40+00:00
State: open

pry(main)> VProduct.update_ngram_index
NoMethodError: undefined method `length' for 39:Fixnum
from /home/sallas/.rvm/gems/ruby-1.9.2-p290/gems/mongoid_fulltext-0.5.1/lib/mongoid_fulltext.rb:185:in `all_ngrams'

pry(main)> VProduct.all.each do |n|
pry(main)* n.update_ngram_index
pry(main)* end
NoMethodError: undefined method `length' for 39:Fixnum
from /home/sallas/.rvm/gems/ruby-1.9.2-p290/gems/mongoid_fulltext-0.5.1/lib/mongoid_fulltext.rb:185:in `all_ngrams'
pry(main)>

* mongoid (2.3.2)
* mongoid_fulltext (0.5.1)

class VProduct
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::FullTextSearch

field :vid, :type=>Integer ### ursprüngliche id in der Datenbank von viterma

field :pnr # Artikelnr - Kurzbez
field :pnr2 # Artikelnr2 - Ersatznummer
field :name # name - Bezeichnung
field :dscr # description - Beschreibung
field :unit # unit/Stück - Einheit
field :cmnt # comment - Anmerkung
field :img # - Bild
field :dltm, :type=>Integer # deliverytime Lieferzeit
field :price#, :type=>Float # preis wenn VK_2 = 0 dann VK_6 ??
field :changed_by # user

belongs_to :v_group

validates_presence_of :vid

embeds_many :p_images

fulltext_search_in :vid, :pnr, :pnr2, :name
index :vid, unique: true
end