Skip to content

Instantly share code, notes, and snippets.

@thredup
Created April 2, 2011 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thredup/899717 to your computer and use it in GitHub Desktop.
Save thredup/899717 to your computer and use it in GitHub Desktop.
Additional Schema for Sphinx Post
has_many :recent_kids_packages, :conditions => ["packages.created_at > ?",6.months.ago], :class_name => "Package", :foreign_key => "parent_id"
has_many :girls_sizes, :source => :size, :through => :recent_kids_packages, :conditions => {"packages.gender" => 'girls'}, :foreign_key => "size_id"
has_many :boys_sizes, :source => :size, :through => :recent_kids_packages, :conditions => {"packages.gender" => 'boys'}, :foreign_key => "size_id"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment