lib/mls/models/listing.rb in mls-0.9.4 vs lib/mls/models/listing.rb in mls-0.9.5
- old
+ new
@@ -151,13 +151,14 @@
def rate?
!!@rate
end
# TODO: remove /desk/mo conversions
- def rate(units='/sqft/mo')
+ def rate(units=nil)
return nil if !@rate
-
+ units ||= rate_units
+
price = if rate_units == '/sqft/mo'
if units == '/sqft/mo'
@rate
elsif units == '/sqft/yr'
@rate * 12.0
@@ -218,10 +219,10 @@
elsif rate_units == '/desk/mo'
if units == '/sqft/mo'
@rate / 200.0
elsif units == '/sqft/yr'
- ((@rate / 200.0) * 12) / @size.to_f
+ (@rate * 12) / 200.0
elsif units == '/mo'
@rate
elsif units == '/yr'
@rate * 12
elsif units == '/desk/mo'