Yeah! That worked perfect. Post your answer at Stackoverflow and I'll mark it as a correct.
http://stackoverflow.com/questions/7058338/relation-wont-index Thanks! On Aug 15, 2:27 am, Pat Allan <[email protected]> wrote: > Hi Linus > > Try this: > > assoc(:source).priority, :as => :priority > > -- > Pat > > On 15/08/2011, at 7:26 AM, Linus Oleander wrote: > > > > > > > > > I've been struggling with a model named Source for a cupule of hours, > > without success. > > It looks like i can't name my model 'Source'. > > > Is there a way round this? > > > Right now I'm getting this error: > > > undefined method `priority' for #<ThinkingSphinx::Source: > > 0x00000106c878f8> > > > Here is my model: > > > class Model < ActiveRecord::Base > > define_index do > > # ... > > has source.priority, as: :priority, type: :integer > > # ... > > end > > > belongs_to :source > > end > > > -- > > You received this message because you are subscribed to the Google Groups > > "Thinking Sphinx" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/thinking-sphinx?hl=en. -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
