Skip to content

Instantly share code, notes, and snippets.

@gamov
Created June 7, 2011 08:01
Show Gist options
  • Save gamov/1011864 to your computer and use it in GitHub Desktop.
Save gamov/1011864 to your computer and use it in GitHub Desktop.
Model Optimisation
def any_missing_specs
if item_variants.loaded?
item_variants.any?{|si| si.m3 == 0 || si.weight == 0}
else
item_variants.where({:m3 => 0 } | {:weight => 0}).size != 0 #metawhere
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment