Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created October 19, 2011 18:03
Show Gist options
  • Select an option

  • Save HeroicEric/1299140 to your computer and use it in GitHub Desktop.

Select an option

Save HeroicEric/1299140 to your computer and use it in GitHub Desktop.
# Finds the product that the variant is for
#
# variant_attr - a hash of attributes for the variant
#
# Returns an instance of Product
def get_variant_product(variant_attr)
product_id = variant_attr["product_id"].to_i
product = Product.find(product_id)
product
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment