# File lib/thinking_sphinx/association.rb, line 102 def primary_key_from_reflection if @reflection.options[:through] @reflection.source_reflection.options[:foreign_key] || @reflection.source_reflection.primary_key_name elsif @reflection.macro == :has_and_belongs_to_many @reflection.association_foreign_key else nil end end