Created
May 10, 2012 22:55
-
-
Save bionicpill/2656444 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
diff --git a/app/models/property_mixins/property_pricing.rb b/app/models/property_mixins/property_pricing.rb | |
index ada5f95..c6210ab 100644 | |
--- a/app/models/property_mixins/property_pricing.rb | |
+++ b/app/models/property_mixins/property_pricing.rb | |
@@ -1,4 +1,6 @@ | |
module PropertyPricing | |
+ include ActionView::Helpers::NumberHelper | |
+ | |
def price | |
if sold? && read_attribute(:sp) | |
read_attribute(:sp) | |
@@ -7,6 +9,10 @@ module PropertyPricing | |
end | |
end | |
+ def price_for_display | |
+ number_to_currency(price, :precision => 0) | |
+ end | |
+ | |
def has_price_drop? | |
!!last_price_drop_at && last_price_drop[:change] | |
end | |
@@ -24,7 +30,7 @@ module PropertyPricing | |
else | |
{} | |
end | |
- end | |
+ end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment