Skip to content

Instantly share code, notes, and snippets.

@bionicpill
Created May 10, 2012 22:55
Show Gist options
  • Save bionicpill/2656444 to your computer and use it in GitHub Desktop.
Save bionicpill/2656444 to your computer and use it in GitHub Desktop.
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