Created
August 29, 2012 08:52
-
-
Save axsuul/3508751 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class OtoplastikCustomer < Customer | |
def otoplastik? | |
true | |
end | |
def prices(article) | |
query = lambda do |merchant_code| | |
OtoplastikArticlePrice.where("otoplastik_article_id = ? AND merchant_code = ?", article.id, merchant_code).order("minimum DESC") | |
end | |
prices = query.call(article.id) | |
prices = query.call(self.price_group) unless prices.exists? | |
prices = query.call(self.price_list) unless prices.exists? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment