ruby on rails - Thinking Sphinx - undefined method `klass' -


i have artwork model associated models subject, location, keyword, style, , medium habtm. have association artist model one-to-many. here's error keep getting:

>rake ts:index generating configuration /users/<user>/developer/jtodd/jtoddgalleries/config/development.sphinx.conf rake aborted! nomethoderror: undefined method `klass' nil:nilclass 

here's indices file:

thinkingsphinx::index.define :artwork, :with => :active_record     indexes title, :sortable => true     has jtg     has width     has height       has subject.id, :as => :subject_ids     has location.id, :as => :location_ids     has keyword.id, :as => :keyword_ids     has artist.first_name, :as => :artist_first     has artist.last_name, :as => :artist_last      has style.id, :as => :style_ids     has medium.id, :as => :medium_ids end 

i can't figure out why keep getting different errors. may not have firm grasp on fields vs. attributes , maybe that's i'm going wrong. appreciated, thank you!

i'm presuming associations listed in artwork model plural names? needs same in index definition.

as fields vs attributes, rule of thumb expect user type in , results should field. so, i'm guessing you'd want artist first , last names fields.

thus, amended index definition:

thinkingsphinx::index.define :artwork, :with => :active_record   indexes title, :sortable => true   indexes artist.first_name, :as => :artist_first   indexes artist.last_name,  :as => :artist_last   has jtg   has width   has height    has subjects.id, :as => :subject_ids   has locations.id, :as => :location_ids   has keywords.id, :as => :keyword_ids   has styles.id, :as => :style_ids   has mediums.id, :as => :medium_ids   # or media? end 

if you're still getting error, can run rake ts:index --trace , share backtrace us? :)


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -