Skip to content
Browse files

Fixes

  • Loading branch information...
1 parent ac67170 commit b8006bdc63acbbe18699b6d0d11afd920f5a7aad @waratuman waratuman committed Aug 10, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/mls/models/account.rb
View
7 lib/mls/models/account.rb
@@ -79,11 +79,10 @@ def agent?
def favorites
return @favorites if @favorites
-
response = MLS.get('/account/favorites')
@favorites = MLS::Listing::Parser.parse_collection(response.body, {:collection_root_element => :favorites})
end
-
+
def favorited?(listing)
favorites.include?(listing)
end
@@ -179,4 +178,8 @@ def search(terms)
class MLS::Account::Parser < MLS::Parser
+ def favorites=(favorites)
+ @object.favorites = favorites.map {|a| MLS::Listing::Parser.build(a) }
+ end
+
end

0 comments on commit b8006bd

Please sign in to comment.
Something went wrong with that request. Please try again.