Created
April 15, 2010 10:34
-
-
Save jpzwarte/366959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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