Skip to content

Instantly share code, notes, and snippets.

@0xjmp
Created February 10, 2014 03:14
Show Gist options
  • Save 0xjmp/8909776 to your computer and use it in GitHub Desktop.
Save 0xjmp/8909776 to your computer and use it in GitHub Desktop.
object @product
attributes :id, :name, :sku, :description, :price, :permalink
node(:in_stock){|product| product.in_stock? }
node(:collection){|product| product.collection.name.titleize if product.collection.present? }
child(:square_images) do
node(:image_url){|image| image.attachment.url(:product_medium)}
node(:large_image_url){|image| image.attachment.url(:large)}
node(:mini_image_url){|image| image.attachment.url(:mini)}
end
child(:variants) do
attributes :sku, :id, :product_id
node(:in_stock){|variant| variant.in_stock? }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment