Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created March 21, 2012 17:09
Show Gist options
  • Select an option

  • Save mgreenly/2149601 to your computer and use it in GitHub Desktop.

Select an option

Save mgreenly/2149601 to your computer and use it in GitHub Desktop.
class SalesOrder < ActiveRecord::Base
def self.stock
# complex logic to define what a stock order is
end
def stock?
SalesOrder.stock.exists?(self)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment