Skip to content

Instantly share code, notes, and snippets.

Created November 7, 2013 23:50
Show Gist options
  • Save anonymous/5a854fdf9b04fe8941c6 to your computer and use it in GitHub Desktop.
Save anonymous/5a854fdf9b04fe8941c6 to your computer and use it in GitHub Desktop.
class Product < AR::Base
scope :valid, -> { where('validity >', validity_date) }
end
class SubProduct < Product
class << self
def validity_date
#some code
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment