Skip to content

Instantly share code, notes, and snippets.

@jpzwarte
Created April 15, 2010 10:34
Show Gist options
  • Save jpzwarte/366959 to your computer and use it in GitHub Desktop.
Save jpzwarte/366959 to your computer and use it in GitHub Desktop.
def teacher_plus?(level)
products.first(
:joins => :levels,
:conditions => [ "(licenses.expires_at > ?) AND domains.id = ?", Time.now.to_date, level ],
:order => "products.product_type DESC").try(:product_type) == 'teacher_plus'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment