Permalink
Browse files

Fixing brokeness.

  • Loading branch information...
1 parent afe5038 commit 3378f9e8e272344990a6e8e65ff9d0cd9d3a1c0c @waratuman waratuman committed Sep 18, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/mls/models/listing.rb
@@ -107,7 +107,7 @@ def leased?
# listing.request_tour('', 'emai', info) # => #<MLS::TourRequest> will have errors on account
def request_tour(name, email, info={})
params = {:account => {:name => name, :email => email}, :info => info}
- MLS.post("/listings/#{id}/tour_requests", params, 400) do |response|
+ MLS.post("/listings/#{id}/tour_requests", params, 400) do |response, code|
return MLS::TourRequest::Parser.parse(response.body)
end
end
@@ -122,7 +122,7 @@ def create
def save
return create unless id
- MLS.put("/listings/#{id}", {:listing => to_hash}, 400) do |code, response|
+ MLS.put("/listings/#{id}", {:listing => to_hash}, 400) do |response, code|
if code == 200 || code == 400
MLS::Listing::Parser.update(self, response.body)
code == 200
@@ -142,7 +142,7 @@ def to_hash
def import #TODO test me
result = :failure
- MLS.post('/import', {:listing => to_hash}, 400) do |code, response|
+ MLS.post('/import', {:listing => to_hash}, 400) do |response, code|
case code
when 200
result = :duplicate

0 comments on commit 3378f9e

Please sign in to comment.