Skip to content

Instantly share code, notes, and snippets.

@fivetwentysix
Created April 5, 2011 12:15
Show Gist options
  • Save fivetwentysix/903486 to your computer and use it in GitHub Desktop.
Save fivetwentysix/903486 to your computer and use it in GitHub Desktop.
for i in 39..47
define_method:"size_#{i}_quantity" do
if self.variants.find_by_size(i)
self.variants.count_on_hand
else
0
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment