Created
August 29, 2012 08:50
-
-
Save radar/3508742 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 find_prices(article_id, merchant_id) | |
| OtoplastikArticlePrice.where("otoplastik_article_id = ? AND merchant_code = ?", article.id, self.id).order("minimum DESC") | |
| end | |
| def prices(article) | |
| prices = find_prices(article.id, self.id) | |
| unless prices.exists? | |
| prices = find_prices(article.id, self.price_group) | |
| end | |
| unless prices.exists? | |
| prices = find_prices(article.id, self.price_list) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment